Agents: read-only agent-to-agent observer in the chat card + live agent.message
ci / gates (push) Successful in 5s
ci / rust (push) Failing after 12s
ci / frontend (push) Successful in 26s
ci / e2e (push) Has been skipped

A new "Observe" button (Eye) sits next to "+ New" in the agent chat header; clicking
flips the card into a read-only observer of that agent's conversations with other
agents, updating live as messages happen.

- frontend: AgentObserver (history from /api/claw-chat/* + live agent.message overlay
  filtered to the agent, read-only banner, no composer); ClawChatSection toggle + flip.
- backend: emit a live agent.message run-event when chat.send succeeds — events.rs
  AgentMessage variant, chat.send returns to_id, runtime emits in both tool paths,
  world.rs normalizes agent_message → agent.message SSE. No migration, no new table.

Roadmap (not built): group/multi-party rooms; A2A protocol (a2a-rs) adoption.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
Omar Sobh
2026-06-27 09:57:29 -07:00
co-authored by Claude Opus 4.8
parent f1f1f4f862
commit 66c4a80985
6 changed files with 228 additions and 3 deletions
+19
View File
@@ -133,6 +133,25 @@ fn normalize_run_event(
json!({ "doorId": door_id, "agentId": agent_id, "action": action, "target": category, "summary": action }),
));
}
"agent_message" => {
let s = |k: &str| {
payload
.get(k)
.and_then(|v| v.as_str())
.unwrap_or("")
.to_owned()
};
out.push((
"agent.message",
json!({
"fromAgentId": agent_id,
"toAgentId": s("to_agent_id"),
"toName": s("to_name"),
"text": s("text"),
"threadId": s("thread_id"),
}),
));
}
_ => {}
}
out