Repository navigation
fix(agents): label live peers that predate discovery publication - #2309
Conversation
A session started before discovery publication (#1714/#1720) heartbeats the schema-1 presence header but never writes a discovery sidecar, so orchestrator_list rendered every field as unknown. When the header is recent and the sidecar is absent, show the header label with an explicit legacy marker. Invalid or foreign sidecars and stale heartbeats still fail closed. Closes #2305
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
End-to-end check in a live session (after Before the change the same peer rendered as |
…list A peer that predates discovery publication never publishes its repository scope, so rendering repository and metadata as unknown contradicted the legacy marker on the same row. Render them as not published and legacy, and pin the full row through the registered tool.
Closes #2305
Problem
orchestrator_listrendered live peers ascontext: unknown · repository: unknown · metadata: unknown, leaving the operator with indistinguishable session IDs.Root cause
The affected peers are long-lived sessions whose loaded code predates discovery publication (#1714/#1720, merged 2026-10-03, first released in v4.1.0). They heartbeat the legacy schema-1 presence header (with its label) but never write the discovery sidecar, so the reader correctly fails closed. Reproduced on Linux with a peer started on 2026-10-02: recent header labeled
gentle-shell, no discovery sidecar.Change
lib/orchestrator-presence.ts:discoveryAbsent()is true only when the sidecar does not exist (ENOENT); a present but unreadable sidecar is not absent.lib/orchestrator-discovery.ts: a peer with a recent header and no sidecar gets a display-onlylegacyLabel;freshnessstaysunknown.extensions/gentle-agents.ts:orchestrator_listrenders such peers as<label> · context: legacy (this session predates discovery publication; restart it to publish its workspace and repository) · repository: not published · metadata: legacy.Unchanged and still fail-closed: invalid sidecars, metadata bound to another activation, stale heartbeats.
orchestrator_consultmetadata staysunavailablefor legacy peers.Verification
tests/orchestrator-discovery.test.ts: legacy label for a live peer without a sidecar (red before the change, green after); no label for invalid or foreign sidecars.tests/gentle-agents.test.tspins the fullorchestrator_listrow through the registered tool (red before the change, green after) and checks thatorchestrator_consultstaysunavailable.pnpm test: all stages pass (unit-tests, provider-contract, runtime-harness) at4c44f34a4on based72c28ae1.pnpm typecheck: 0 diagnostics.legacyLabel=gentle-shell; the other four peers are unchanged.Out of scope
Transport arming on Windows (#2166), hidden transport errors (#2124), stale peer advertisements (#1443), the recipient picker (#1308). Presence-scan hardening (full traversal past the 128-entry page, stale duplicate headers left by resumed sessions) goes to a separate PR referencing #2305.
Summary by CodeRabbit