Skip to content

WebSocket Events

Repowire peers use WebSocket delivery for live messages and daemon events. The daemon remains the routing hub; transports decide how to present those messages to a runtime.

Message families

  • ask — tracked question that must be closed with ack.
  • notify — fire-and-forget message.
  • broadcast — mesh-wide announcement.
  • Dashboard events — timeline, peer, chat-turn, tool-call, and operational events. peer_status carries the peer's status and, when it has one, its turn_state (working, awaiting_input, idle, ...), recorded once per runtime report with the turn state applied first, and also when only the turn state changed; apply it to the peer in place rather than rereading /peers. peer_online and peer_offline carry status and turn_state too, so a surface adds or patches the peer from them; reread /peers for changes the event does not describe (peer_updated, peer_reaped). Includes peer_contradiction events, emitted (once per transition) when lazy repair detects a peer in a self-inconsistent state such as online-but-no-WebSocket, and ask_delegated (correlation_id, from, to, asker, note, hops) when an ask is delegated. Two events record how spawned agents end, without changing peer state (rfcs/agent-container.md, step 2). agent_exit_observed (peer_id, pid, pane_id, peer_status) is emitted when a spawned agent's process exits. exit_signal_checked (signal, peer_id, pid, agent_alive, watched) is emitted when a tmux pane-died or session-closed signal offlines a spawned peer, and says whether its agent was still running.

ask and notify frames to an agent peer carry an optional message_id, the recipient's message record; renderers show it as message-id="..." on the <peer-message> tag. For a peer in pull delivery the frame's text is a one-line nudge naming that id instead of the body.

A connect frame may carry native_name, the runtime's own session name; the connected reply's display_name is then that name, normalized (OpenCode and Pi send it). Renames are reported over HTTP (POST /session/update); there is no rename frame.

The ws-hook connect frame advertises hook_version and capabilities (e.g. delivery_receipts) so the daemon can report per-peer inbound health and receipt support; capability is also inferred from an observed delivery acknowledgement.

Compatibility

The exact event payloads are transport-facing internals unless documented by an HTTP route or MCP tool. Prefer MCP tools for agent actions and the HTTP API for external integrations.

Observed Codex command activity

The command schema of the optional client-to-daemon activity_observation frame uses codex-command-0.172.0-v1. The bridge gates this profile on the initialize user-agent build version: ONLY exact 0.172.0 and 0.174.0 are supported. The profile string is a historically named logical normalizer contract, not a runtime-version assertion. Both pinned source versions have identical command identity, lifecycle and nullable result conversion, so the wire profile and subject/event IDs stay unchanged. Unknown versions, including 0.173.0, 0.174.1 and prereleases, keep legacy summaries without typed capture. The installed CLI version is not proof of the initialized AppServer version; payload-free diagnostics report the latter. Healthy service availability and source-contract compatibility do not establish observed live command coverage. See pinned references in daemon-go/codexbridge/testdata/command-0.172.0.SOURCE.md and command-0.174.0.SOURCE.md; fixtures are source-derived, not provider recordings.

The frame contains runtime session, native turn/item IDs, started/completed, source status, command, nullable aggregate output/exit code and truncation flags. It cannot select another peer, machine, durable session, authority or activity family. Admission requires the actual current registered socket and an active Codex runtime binding. Claude, file/MCP/subagent capture, output deltas and raw history backfill are not part of this profile. A native subagent relationship, mesh delegation, approval and durable work remain separate source-owned facts.

The daemon's private-controller event is runtime_activity: stable subject ID, source observation, separate lifecycle/outcome, bridge_observed authority and last_observed freshness with partial coverage. An ended command with no explicit exit/outcome remains unknown; a nonzero exit is failed even if the provider says completed. declined remains distinct. Tool-only turns do not wait for final assistant prose. An open event stream does not prove a command is still running or that all activity was captured.

Command previews are at most 4 KiB and output previews at most 16 KiB of UTF-8; total encoded frame is at most 24 KiB, so JSON escaping can require smaller previews. Bounds are not a guarantee that arbitrary secrets are removed. No cwd, environment, hidden reasoning or arbitrary raw objects are captured. The registered controller's existing authenticated event routes carry this data. Anonymous shares, analysis/export reads, peer-forwarding and push do not.

Events are inserted before any live/observer fanout. A duplicate keeps its original server timestamp and publishes nothing. Conflicting data does not replace the first observation: one deterministic references-only conflict marker makes the subject's outcome unknown, including after restart. Both observations and markers use existing content retention. GET/SSE replay filters expired activity still present in the memory window. Typed history consists only of the retained journal/window; old disk transcripts are not republished. The existing missing-cursor fallback returns its retained window, which remains partial coverage rather than a contiguous history guarantee.

This daemon protocol slice does not add a new app tab, tool controls, execution permissions or universal backend lifecycle. Native/web rendering integration is a separate coordinated change within the existing conversation/navigation.

Telemetry uses one bounded asynchronous sender per mesh connection. The app-server RPC reader never waits for its write lock or network; busy control writers and a full one-frame queue cause telemetry loss (coverage stays partial). No short telemetry-owned cancellation deadline closes the primary control socket. One bounded frame still shares normal socket backpressure, so this is not a promise of zero control latency. Queued observations never retarget a replacement socket. The event's machine value is the daemon-observed peer machine label, not attested storage/routing authority; consumers keep their authenticated outer machine scope.

Local command coverage diagnostics

The bridge logs a normalized numeric initialized version (or unrecognized) and whether the reviewed activity profiles are enabled. It counts only live item-started/completed notifications into fixed command/MCP/dynamic/file-change/ collaboration/other buckets, plus fixed gate/queue/write dispositions. Native IDs, raw user agents, hostnames, arguments, previews, and runtime error text are omitted.

Reports are best effort: at most one initialization report and the first report for each kind/phase and disposition per AppServer connection. count_at_report is the counter when the worker formats that report, not a complete session total. An independent logger avoids the default logger mutex; the same OS stderr sink can still impose baseline backpressure on unrelated writers. Each queued observation carries its originating AppServer diagnostic context across mesh-socket reuse. One bounded queue and worker per bridge lifetime keep slow log output off the AppServer reader and control writer; reports can drop under contention. The worker stops with bridge context once any current log write returns. There is no timer, new endpoint, payload logger, or historical backfill count. Queued/sent means only bridge queue/write progress, not daemon admission or durable activity. An absent report, or no typed events in a retained window, does not establish no commands.

Observed MCP and dynamic-tool metadata

Two additional strict logical profiles, codex-mcp-v1 and codex-dynamic-v1, use the SAME frame/event transport and exact initialized-version gate: only 0.172.0 and0.174.0. They consume canonical live item/started/item/completed notifications, not legacy events, item/tool/call execution requests or history. The command schema/profile/subject IDs are unchanged. Unknown clients skip these new kinds while retaining ordinary events/cursors/legacy chat.

The event remains runtime_activity, version1/familytool, with kindmcp or dynamic. New observations retain exact runtime/turn/item identity, phase/status, tool and nullable server/namespace display labels, labels_limited, nullable dynamic success or MCP error_present, source_inconsistent and literal-true input_omitted, result_text_omitted and error_text_omitted. Required nullable facts must be present on the frame; missing/malformed source facts map unknown, never false. Unknown fields and duplicate frame keys are rejected. Source IDs are never shortened; display labels are UTF8-bounded to128bytes each with control replacement/limits.

This first slice captures zero argument, result or error body bytes. No arbitrary JSON, structuredContent/_meta, environment, hidden reasoning, media, URLs/resource/app context or raw fallback enters the new typed observation. Labels are private source-observed text, not trusted addresses or controls. This policy applies to the new typed path; existing legacy chat summaries are unchanged and may independently contain the same names/text. It is not global redaction.

MCP completed means ended/unknown, not business success. Explicit failed status is failed. Dynamic completed with explicit true success is provider-reported success; failed with false/null is failed; completed with null stays unknown. Contradictory completed+false/failed+true, or MCP completed+error_present=true, are inconsistent/unknown. A started observation with an unexpected success/error fact is inconsistent and running/unknown. Reducers OR source_inconsistent across retained observations: later consistent completion cannot erase earlier evidence. This flag is distinct from a durable journal conflict; missing prefixes are partial/unknown, not fabricated inconsistent facts. No cancelled/declined/tool permission/subagent/work ownership state is invented from these profiles.

All families SHARE the existing16/sec admission,128 tracked starts and one worker/ one pending sender per current connection, including actual socket/runtime binding checks. Late ends still require exact retained start; DB-before-fanout, immutable first timestamps, refs-only conflicts, private audiences and content cutoffs apply unchanged. Metadata labels do not enter canonical identity; new subject keys include family/profile/native runtime+turn+item and origin namespace. The observed machine label is not owning-machine authority. No new polling/store/cursor exists.

Subscription remains limited: naturally new threads can autoattach to an already initialized normal app-server connection; initialize/list/read do not attach preexisting threads and reconnect loses subscriptions. There is no automatic resume or private subscribe. Enabled adapters or empty windows are not full live coverage. See docs/contributing/design-notes/codex-activity-subscription.md.

Fixtures in daemon-go/proto/testdata/tool-activity-v1.json and its SOURCE note are synthetic/source-derived, not provider recordings, upstream Rust execution or live certification. Native/web family renderers are separate coordinated additions to the existing inline activity surface; this daemon slice adds no controls or tabs.