hive-ag3nt: echo turn (placeholder until claude integration)

This commit is contained in:
müde 2026-05-14 22:19:05 +02:00
parent 28b3477216
commit 2fe9e91005

View file

@ -62,6 +62,18 @@ async fn serve(socket: &std::path::Path, interval: Duration) -> Result<()> {
match client::request(socket, AgentRequest::Recv).await {
Ok(AgentResponse::Message { from, body }) => {
tracing::info!(%from, %body, "inbox");
// Placeholder "turn": echo back, prefixed. Phase 3c replaces this
// with `claude --print` once API-key plumbing exists. Don't echo
// an echo, so a manual `send` produces exactly one reply.
if !body.starts_with("echo: ") {
let reply = AgentRequest::Send {
to: from.clone(),
body: format!("echo: {body}"),
};
if let Err(e) = client::request(socket, reply).await {
tracing::warn!(error = ?e, "send reply failed");
}
}
}
Ok(AgentResponse::Empty) => {}
Ok(AgentResponse::Ok) => {