agent: add Wake command - co-process self-wake via agent socket

This commit is contained in:
damocles 2026-05-16 03:36:16 +02:00
parent 286da8980e
commit f0e87f0bc5
2 changed files with 22 additions and 0 deletions

View file

@ -188,5 +188,20 @@ async fn dispatch(req: &AgentRequest, agent: &str, coord: &Arc<Coordinator>) ->
},
}
}
AgentRequest::Wake { from, body } => {
// Deliver a message to this agent from a co-process (e.g. a
// Matrix daemon). Identical to `Send { to: agent }` but the
// recipient is always the owning agent — no routing needed.
match broker.send(&Message {
from: from.clone(),
to: agent.to_owned(),
body: body.clone(),
}) {
Ok(()) => AgentResponse::Ok,
Err(e) => AgentResponse::Err {
message: format!("{e:#}"),
},
}
}
}
}