GeezerVison is showing github.com — mcpx: Phase 3 of #1384 — supervised stdio by default + lifecycle hygiene · Issue #9963 · developing-today/code
mcpx: Phase 3 of #1384 — supervised stdio by default + lifecycle hygiene #9963DescriptionPhase 3 of epic #1384 — supervised by default + lifecycle hygiene
Parent design: #1384 (adopted by Drew 2026-10-27: per-instance mcpx supervisor replaces the stdio takeover handoff). Depends on Phase 2 (takeover becomes attach for supervised instances), filed alongside this issue from #1384.
Scope
- Supervised stdio becomes the default; the legacy stdio handoff remains only as the fallback path.
- Adopt-or-reap scan on daemon start: running supervisors for configured instances are adopted; orphaned supervisors are reaped with the reap logged.
mcpx restart operates through the supervisor (child PIDs survive a daemon restart by default).
- Protocol-version refusal between daemon and supervisor is surfaced in status, not silently worked around.
- Darwin build/test parity: shrink mcpx: takeover/upgrade/handoff unsupported on darwin; Linux-only tests break the darwin build #237's skip list to the legacy handoff only.
Acceptance criteria
Filed by fleet triage (task 15159, lane code-d, 2026-11-14) per #1384's acceptance item 2: implementation issues exist for each phase. Activitydeveloping-today commented on Nov 14, 2026 dezren39 commented on Nov 14, 2026 🤖 Agent note · triage: valid phase issue, correctly gated on Phase 2
- Agent: repo queue worker (repo-worker-code), lane code-a
- Session / ID: task 16788
Verified fresh (2026-11-14):
Routing: no packet enqueued for Phase 3 — it unblocks when #9962 lands, and #9962 is already queued ahead of it (the queue's priority order will surface it first). Issue #9963 is labeled status/blocked + queue/blocked to record the gate; when #9962 closes, a triage pass can flip it back to queued and packet it against the landed attach semantics.
dezren39 commented on Nov 14, 2026
Agent note — task 16880 blocked on dependency (lane any-b)
dezren39 commented on Nov 22, 2026 Merged work, still open. Every pull request that references this issue has merged (#10767, #11343) and none is open, but the issue kept status:in-review. Tasks that name it as a blocker have been waiting on it.
status:in-review is removed. Whoever takes this next: run the issue's done check against main. Close the issue if it passes; if not, list what is left here and carry on with it (AGENTS.md, "Finishing work").
By: Claude, 2026-11-22 flow review.
Generated by Claude Code dezren39 commented on Nov 23, 2026 Current default and acceptance check · program #13264. PR #11343 restored direct stdio as the default. In the supervisor socket code the control socket is derived from the configured name in one state directory. The default oracle records the per-instance requirement. Before restoring the default, exercise two legitimate instances of the same configured server and verify distinct control sockets, the correct child surviving frontend restart, and compatibility for existing name-keyed sockets. Keep Darwin verification tracked separately. This is a source finding; no supervisor or live process was modified. dezren39 commented on Nov 24, 2026 🤖 Agent note · second pass (pass 2 of 3, coverage reconciliation)
Fresh verification (2026-11-24)
- Issue OPEN, labels
kind/feature + priority/normal + effort/l + app/mcpx + epic/mcpx-platform, no status label (the 2026-11-22 flow review removed status:in-review). Correct as-is.
- Phase 3 landed via PR feat(mcpx): supervised stdio by default + adopt-or-reap + restart through supervisor (#9963) #10767 (task 17484, done 2026-11-16), then PR fix(mcpx): make supervised stdio opt-in again #11343 (merged 2026-11-17) reverted the headline default to opt-in: supervisor socket keyed by server name only (second scoped instance collides with
already attached) + supervisors outlive mcpx stop. Acceptance checkbox 1 (supervised by default) is unmet on main; the rest (restart-through-supervisor, adopt-or-reap, refusal-in-status) still applies to opt-in servers.
- The way back is specified on record (PR fix(mcpx): make supervised stdio opt-in again #11343 body + 2026-11-23 program-mcpx program — full-investigation prompt: design completion & build-out for the MCP gateway #13264 review note): key socket per instance (pool identity + scope key) with compat for existing name-keyed sockets, reap supervisors on
mcpx stop, verify two same-server instances get distinct sockets + correct child survives frontend restart, Darwin verification tracked separately.
- No live queue item covers this (checked queued/claimed/parked 2026-11-24). Prior work terminal: triage 16788/16880, implementation 17484 (done — but its merge was partially reverted a day later).
Routing attempt (blocked by broker, not by the work)
- Prepared a scoped
small_fix follow-on (priority 50, timebox 120): per-instance socket keying + stop-reaps + restore default + tests + darwin. Packet validated clean (packet valid (repo-task/v1)).
- Enqueue refused:
dedupe hit: existing task 17484 (status done) — the serving broker treats the canonical fix key as held even though the holder is terminal, and does not honor the documented revived_from-envelope path (tried revived_from: 17484, same hit). Filing under a different kind key would miscategorize the work, so no row was filed.
- Ready-to-file spec for any lane with a working path (broker fix,
revive-with-rewrite, or programme mcpx program — full-investigation prompt: design completion & build-out for the MCP gateway #13264 executors): same repo/issue/kind/priority as attempted; acceptance = mcpx: Phase 3 of #1384 — supervised stdio by default + lifecycle hygiene #9963 checkboxes 1–4 adapted to per-instance sockets + stop-reaps + compat + darwin; scope includes socket keying, stop reaping, default restore with opt-out, refusal-in-status, mcpx: takeover/upgrade/handoff unsupported on darwin; Linux-only tests break the darwin build #237 skip-list shrink; excludes unrelated mcpx refactors.
Verdict
developing-today-fleet commented on Nov 26, 2026 Claim — felix lane (muse seat), 2026-11-25 evening CST.
Taking the unowned remainder identified by the 2026-11-24 second pass: restore supervised-by-default for mcpx stdio servers, with the fixes that forced PR #11343's revert addressed first — per-instance supervisor socket keying (pool identity + scope key) with compatibility for existing name-keyed sockets, and supervisors reaped on mcpx stop.
Scope per the on-record spec: socket keying, stop reaping, default restore with the "supervised": false opt-out preserved, refusal-in-status kept, tests for two same-server instances (distinct sockets, correct child survives frontend restart) and both adopt/reap branches; Darwin verification tracked separately as the record directs. Working from a sandbox seat with remote-only builds; PR will land unmerged for Felix's review. developing-today-fleet commented on Nov 26, 2026 Restore implemented — PR #15398 (branch felix/9963-supervised-default-restore, left unmerged for Felix's review).
What landed
config.parse materializes supervised: true for stdio servers again (explicit false remains the one opt-out), restoring the feat(mcpx): supervised stdio by default + adopt-or-reap + restart through supervisor (#9963) #10767 default.
- Per-instance socket keying, per fix(mcpx): make supervised stdio opt-in again #11343's prescription:
SupervisorSocketPathForInstance(stateDir, name, scopeKey); the pool threads rs.Key through dialMode into SupervisedOptions.Instance. Primary instance (empty/global key) keeps the historical name-only socket for adoption compatibility; the adopt-or-reap scan classifies by the server segment of the socket filename, so scoped instances of a configured server count as configured.
mcpx stop and mcpx stop --all reap the stopped config's supervisors via the new mcpclient.ReapSupervisors (bounded refusal retry for the daemon's async detach; a still-refused supervisor is reported and left in place). Daemon restarts still adopt — only the explicit stop reaps.
- Inline mode resolves its private config copy with supervision off: an in-process daemon lives for one command, and supervised children outliving it in the shared state dir were the inline half of fix(mcpx): make supervised stdio opt-in again #11343's failures.
TestSuperviseKeepsTheChildAcrossADaemonStop updated: it asserted survival across mcpx stop, the behavior fix(mcpx): make supervised stdio opt-in again #11343 requires stop to end; it now kills the daemon process and pins survival across daemon death/restart with re-adoption.
Verification (remote, fleet-command dispatches against developing-today/fleet)
- Run 45755947734:
go test ./internal/config/ ./internal/mcpclient/ ./internal/pool/ ./internal/cli/ ./internal/daemon/ -count=1 — all five packages ok, PKG_TESTS_OK.
- Run 45753460532:
scripts/darwin-compile-check.sh DARWIN_OK; named e2e 7/7 PASS — TestSuperviseKeepsTheChildAcrossADaemonStop, TestNoOrphanProcessesAfterStop (passes under the restored default), TestInlineModeRunsWithNoDaemonAndLeavesNothingBehind, TestInlineModeRunsAScriptThatCallsATool, TestTakeoverAttachesToSupervisedChild, TestTakeoverKeepsTheChildAndTheListener, TestRepoAndWorktreeScopesResolveWithNoGitInstalled.
- Run 45755962209: changed/new tests under
-race -shuffle=on -count=5 (config, mcpclient, pool, cli) — all ok, FLAKE_OK.
- Run 45754607197: the new tests by name — TestSupervisorSocketPathForInstanceKeying, TestTwoInstancesSameServerDistinctSupervisors, TestScanAndReapAcrossInstances, TestDefaultConfigStdioRunsSupervised, TestSameServerTwoScopesGetDistinctSupervisors, TestStopAllReapsStoppedConfigsSupervisors — all PASS.
- Negative controls (throwaway branch with the materialization reverted in place; branch deleted after): run 45756022549 — TestSupervisedDefaultsOnForStdioFromFile FAILS ("a stdio server with no supervised key should be supervised by default"); run 45756750557 — TestDefaultConfigStdioRunsSupervised FAILS at the resolved-config assertion.
- First full run 45753420137 is superseded by the above: its only failures were three harness defects in my own new tests (pool max defaulting to 1, an attach slot held by a deferred close, and a fake daemon that closed its listener but not its pooled health connection), each fixed in e2a1809 with the reason recorded in the commit message.
Acceptance state
- Criterion 1 (default config supervised): done, tests above.
- Criterion 2 (adopt-or-reap both branches): done — existing phase-3 scan test plus the new cross-instance scan/reap test.
- Criterion 3 (status names protocol refusal): done — TestAdoptProtocolRefusalSurfacesInStatus, unchanged and green.
- Criterion 4 (darwin skip list shrinks to legacy-handoff only): NOT done here — verification needs a darwin builder, unreachable from this seat. Filed as mcpx: shrink the darwin skip list to legacy-handoff tests only (#9963 criterion 4) #15397 (the list is
darwinSkip in pkgs/mcpx/package.nix in this repo). This issue stays open for that criterion; the PR is Refs-only, not Closes.
One judgment call recorded for review: a pre-upgrade supervisor of a scoped server sits on the name-only socket; after this lands it classifies as configured and is reaped by the next mcpx stop, but a restarted daemon starts a fresh child on the per-instance socket rather than re-adopting it. Global-scope servers (the common case) re-adopt seamlessly. developing-today-fleet commented on Nov 26, 2026
Triage verdict — task 24697 (lane code-g, 2026-11-26)
Issue is actionable-but-covered: no new task filed; parent stays open for the #15407-blocked remainder.
Fresh check against origin/main:
Live coverage (no duplication):
Next: #9963 closes when #15407 lands (unskips the 2 e2e tests) and the done check passes. No follow-on filed under dedupe repo-health:v1:fix:developing-today/code:issue:9963 — terminal task 17484 holds the key and live children cover the remainder. dezren39 commented on Nov 27, 2026
Triage disposition — task 25222 (lane xaltha, 2026-11-26): duplicate draw, no new work.
This task was imported by coverage reconciliation at 23:07Z; the full triage was completed 30 minutes later by task 24697 (verdict above, 23:37Z). I re-verified its facts fresh rather than redoing it:
#9963 closes when #15407 lands and the done check passes. No follow-on filed (dedupe key held by terminal task 17484; live children cover the remainder).
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|