hive-ag3nt: echo turn (placeholder until claude integration)
This commit is contained in:
parent
28b3477216
commit
2fe9e91005
1 changed files with 12 additions and 0 deletions
|
|
@ -62,6 +62,18 @@ async fn serve(socket: &std::path::Path, interval: Duration) -> Result<()> {
|
||||||
match client::request(socket, AgentRequest::Recv).await {
|
match client::request(socket, AgentRequest::Recv).await {
|
||||||
Ok(AgentResponse::Message { from, body }) => {
|
Ok(AgentResponse::Message { from, body }) => {
|
||||||
tracing::info!(%from, %body, "inbox");
|
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::Empty) => {}
|
||||||
Ok(AgentResponse::Ok) => {
|
Ok(AgentResponse::Ok) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue