Supervision IPC: daemon state + live agent list over the control socket - #442
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…apshot Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e status/1 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…stress Extends DaemonStatusIpcTests with the real-socket behavior matrix: every mutation re-pushes, a pulse burst coalesces into one trailing snapshot, two subscribers converge independently via their own cursors, a mutation landing exactly at the snapshot/cursor boundary still converges (via the self-clearing AfterSnapshotForTest hook), subscriber EOF reaps the handler promptly, concurrent mutations never produce an internally-inconsistent payload, and a shutting-down daemon just closes the subscription. Test-only: adds the ReadOrNullAsync helper, makes the harness's server stop idempotent (StopServerOnceAsync) since the shutdown test and RunAsync's finally both stop it, and fixes the harness leaking a stateDir temp directory per test. No production changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR Summary by QodoSupervision IPC: daemon status + live agent list over the control socket
AI Description
Diagram
High-Level Assessment
Files changed (23)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e6eb61ea4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await RegisterDaemonAsync(); | ||
| _connectedTimestamp = Stopwatch.GetTimestamp(); | ||
| LogConnected(_config.Name); | ||
| _statusNotifier.Pulse(); |
There was a problem hiding this comment.
Publish initial connection attempt transitions
When a status client subscribes while the initial StartHubAsync attempt is in Connecting, a failed attempt returns the hub to Disconnected and enters the retry delay without reaching this success-only pulse; initial start failures do not invoke the reconnect/closed handlers either. Because DaemonRunner starts LocalControlServer before calling ConnectAsync, this race is reachable and the client can continue displaying connecting throughout an arbitrarily long outage. Pulse the notifier when the initial attempt enters Connecting and again after a failed attempt has returned to Disconnected, rather than only after successful registration.
Useful? React with 👍 / 👎.
Code Review by Qodo
1.
|
…r disconnects, clean test temp dirs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Local spawns store "" for AgentInstance.Model as an internal "no model"
sentinel, and a server-driven launch with a blank requested model can
retain "" too (ModelSelectionLaunchPolicy.Evaluate treats blank as
Honor). SnapshotAgentsForStatus copied Model verbatim, so the supervision
wire emitted two representations ("" and null) for the same absent state
even though the wire contract pins absent = null. Normalize only at the
wire-mapping boundary; AgentInstance itself keeps storing "".
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Implements the supervision surface from the slice-2 pre-work spec (§4, docs/superpowers/specs/2026-08-01-slice2-prework-control-ipc-design.md):
StatusSubscribe = 16opens a long-lived connection that receives fullDaemonStatus = 76snapshots — immediately on subscribe, then debounced re-pushes driven by a monotonic change generation (DaemonStatusNotifier, mutation-first/pulse-second via centralized orchestrator helpers).AgentInstancegainsRequesterUserIdstamped from the launch command. The hello capability list now advertisesstatus/1alongsideconsent/1. Stop reuses the existingStopV2frame — no new stop machinery.No CLI surface changes — this is app-facing IPC only, so no README update is needed.
Notes for the desktop-app consumer (AI-1650):
active_agentscounts Starting/Running agents (display semantics), not the daemon's admission gate (EffectiveCount, which includes kill-quarantine); and a client that routinely disconnects mid-push currently logs a Warning per vanish on the daemon side.AI-1649
🤖 Generated with Claude Code