feat(#1106): transient wake for bash tasks — bypass broker sqlite
This commit is contained in:
parent
b9b58554e8
commit
a1c6736ba5
8 changed files with 102 additions and 19 deletions
|
|
@ -465,6 +465,11 @@ async fn send_wake(socket: &Path, id: &str, summary: &str, output: Option<(&str,
|
|||
let req = hive_sh4re::AgentRequest::Wake {
|
||||
from: format!("bash-task-{id}"),
|
||||
body,
|
||||
// Transient: do not persist to the message broker. Bash task
|
||||
// completions are fire-and-forget — the output is already on disk
|
||||
// in harness/bash-tasks/; persisting would cause duplicate delivery
|
||||
// after a harness restart (issue #1103).
|
||||
transient: true,
|
||||
};
|
||||
match crate::client::request::<_, hive_sh4re::AgentResponse>(socket, &req).await {
|
||||
Ok(_) => tracing::info!(id = %id, "bash_runner: wake delivered"),
|
||||
|
|
|
|||
|
|
@ -316,6 +316,7 @@ impl Surface for AgentSurface {
|
|||
&AgentRequest::Wake {
|
||||
from: "self".into(),
|
||||
body: "continue".into(),
|
||||
transient: false,
|
||||
},
|
||||
)
|
||||
.await;
|
||||
|
|
@ -365,7 +366,7 @@ impl Surface for AgentSurface {
|
|||
|
||||
async fn wake_external(socket: &Path, from: String, body: String) -> Result<()> {
|
||||
let resp: AgentResponse =
|
||||
client::request(socket, &AgentRequest::Wake { from, body }).await?;
|
||||
client::request(socket, &AgentRequest::Wake { from, body, transient: false }).await?;
|
||||
match resp {
|
||||
AgentResponse::Ok => Ok(()),
|
||||
AgentResponse::Err { message } => anyhow::bail!("wake: {message}"),
|
||||
|
|
@ -456,6 +457,7 @@ impl Surface for ManagerSurface {
|
|||
&ManagerRequest::Wake {
|
||||
from: "self".into(),
|
||||
body: "continue".into(),
|
||||
transient: false,
|
||||
},
|
||||
)
|
||||
.await;
|
||||
|
|
@ -505,7 +507,7 @@ impl Surface for ManagerSurface {
|
|||
|
||||
async fn wake_external(socket: &Path, from: String, body: String) -> Result<()> {
|
||||
let resp: ManagerResponse =
|
||||
client::request(socket, &ManagerRequest::Wake { from, body }).await?;
|
||||
client::request(socket, &ManagerRequest::Wake { from, body, transient: false }).await?;
|
||||
match resp {
|
||||
ManagerResponse::Ok => Ok(()),
|
||||
ManagerResponse::Err { message } => anyhow::bail!("wake: {message}"),
|
||||
|
|
|
|||
|
|
@ -684,6 +684,7 @@ async fn poll_once(
|
|||
let req = hive_sh4re::Request::Wake {
|
||||
from: "forge".to_owned(),
|
||||
body,
|
||||
transient: false,
|
||||
};
|
||||
let delivered = crate::client::request::<_, hive_sh4re::Response>(socket, &req)
|
||||
.await
|
||||
|
|
|
|||
Loading…
Reference in a new issue