web/domain_events.py.
| Dataclass | SSE Event | Data Fields | Used In |
|---|---|---|---|
AgentStarted |
started |
session_id, agent_type | Web chat |
TextDelta |
text_delta |
text, agent_type | All flows |
ThinkingDelta |
thinking |
thinking, agent_type | All flows |
ToolInvocationStarted |
tool_use_start |
tool_name, tool_use_id, input, agent_type | All flows |
ToolInvocationCompleted |
tool_result |
tool_use_id, result, is_error, agent_type | All flows |
AgentCompleted |
completed |
usage (dict), success, session_id, agent_type | Web chat, scheduled |
AgentError |
error |
message, error_type, agent_type | All flows |
AgentStatus |
agent_status |
agent_type, status (idle|listening|responding|dead) | Group chat only |
GroupMessagePosted |
group_message |
sender, content, sequence, thread_id, mentioned_agent | Group chat only |
MessageReaction |
reaction |
reactor, sequence, emoji, action (add|remove) | Group chat only |
MessageReadReceipt |
read_receipt |
reader (agent_type), sequences (int[]) | Group chat only |
domain_event_to_sse(event) returns {"event": "...", "data": "..."} where data is a JSON string.
The SSE event name maps directly to the frontend's EventSource listener names.
Agent type is included in the data payload when present (for group chat multi-agent disambiguation).
Group chats emit additional events beyond the agent execution events:
group_message when any participant posts,
agent_status on state transitions,
reaction for emoji reactions,
read_receipt when agents consume messages.
These are broadcast via GroupChatStore._broadcast_sse() to all SSE subscriber queues.
The AgentCompleted.usage dict varies by backend: