Skip to content

mcpx: Phase 3 of #1384 — supervised stdio by default + lifecycle hygiene #9963

Done

Description

@dezren39

Phase 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.

Activity

  1. added
    kind/feature
    priority/normal
    queue/queued
    app/mcpx
    effort/l
    epic/mcpx-platform
    on Nov 14, 2026
  2. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 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.

  4. added
    status/blocked
    queue/blocked
    and removed
    queue/queued
    on Nov 14, 2026
  5. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Agent note — task 16880 blocked on dependency (lane any-b)

  6. removed
    queue/blocked
    on Nov 16, 2026
  7. 21 remaining items

  8. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    Contributor

    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.

  9. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    Contributor

    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.

  10. added a commit that references this issue on Nov 26, 2026
  11. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    Contributor

    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.

  12. added
    queue/parked
    on Nov 26, 2026
  13. dezren39 commented on Nov 27, 2026

    @dezren39
    MemberAuthor

    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).

  14. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    🤖 Census note — 2026-11-29 (lane CEN-C09, full issue census)

    State verified today: criteria 1-3 are MET on main (criterion 1 via PR #15398 merged 2026-11-26; criteria 2-3 via PR #10767). Criterion 4 (darwin skip list shrunk to the legacy handoff only) was partial: PR #15414 shrank the list, leaving 2 e2e darwinSkip entries gated on the #15407 supervisor fix.
    Update — the gate has now cleared: PR #15550 (the #15407 fix) MERGED 2026-11-29T04:19Z and #15407 is CLOSED.
    Remaining work (now ungated): remove the last 2 darwinSkip entries for this phase and re-run the darwin build/test to confirm parity; then this phase is complete.
    Census fixes: none — priority/normal stands.
    Verdict: ready — final slice ungated as of today.

  15. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): full recheck of this issue — details, labels, blockers, priority (rechecked from scratch; prior detail did not exempt it).

    STRENGTHS:

    GAPS FOUND:

    • no concrete file/module pointers in the body

    FIXES I APPLIED:

    • none needed

    PICKUP NOTES (added by this census so the next agent can resolve this cold):

    REMAINS: nothing — ready for pickup

  16. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29 (wave 2 residual pass)

    This issue already carries full census notes from parallel lanes today (CEN-C08/C09 and a Felix seat). I skimmed those notes, re-verified the live state, labels, and body firsthand, and do not duplicate their verdicts — this note records only my residual check and anything I changed.

    Residual check: literal acceptance criteria present ('### Acceptance criteria' checklist in body). Labels adequate (kind/feature, priority/normal, effort/l, app/mcpx, queue/parked).

    Actions taken by this pass: none — no residual fixes remained after the parallel lanes' work today.

    Priority: priority/normal — stands; no band change by this pass.

  17. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · lane 2252-I (bravo SUSTAIN, 2026-11-29) — CLAIM + CLOSE: all four acceptance criteria of #9963 are now evidenced on main.

    Closing as completed. This was the last open phase of #1384. Key: 2252-I

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/mcpxeffort/lepic/mcpx-platformkind/featurepriority/normalqueue/parked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions