GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — design(mcpx): a supervisor that owns each stdio child's pipes — replace the takeover handoff for stdio · Issue #1384 · developing-today/code

design(mcpx): a supervisor that owns each stdio child's pipes — replace the takeover handoff for stdio #1384

New issue
Copy link
New issue
Copy link
Todo
2 / 32 of 3 issues completed
Todo
design(mcpx): a supervisor that owns each stdio child's pipes — replace the takeover handoff for stdio#1384
2 / 32 of 3 issues completed
Copy link
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)epic/mcpx-platformReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobstatus/in-progressQueue worker lifecycle statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state
Milestone
mcpx platform program

Description

@dezren39
dezren39
opened on Oct 27, 2026
Issue body actions

Decision needed (one line): Adopt the per-instance mcpx supervisor design — stdio children owned by a supervisor that outlives the daemon, Phases 2–3 make it the default — or keep investing in the takeover handoff instead?

Summary

Replace the stdio half of mcpx's takeover handoff with one supervisor per stdio instance: a tiny process (the same mcpx binary re-executed as a hidden mcpx supervise subcommand) that spawns each stdio MCP server, owns its pipes for the child's whole life, and serves whichever daemon is currently attached over a unix socket in the state directory. A daemon upgrade then becomes a plain restart of the front end — the new daemon attaches to supervisors that are already running. No pipes move, no descriptors are passed, nothing is detached or restored.

This extends — does not duplicate — the repo's own design thread: pkgs/mcpx/TODO.md item 1 ("Replace the takeover handoff with a supervisor… The current handoff is a stopgap") and planning/roadmaps/mcpx.md → Next → "A supervisor that owns each stdio child's pipes" (status: idea, no issue until now). Full design doc: files/designs/code-mcpx-stdio-supervisor.md in the keep-the-four-repos-healthy goal workspace (registered in files/potential-projects.md).

Current state (evidence)

  • pkgs/mcpx/internal/daemon/takeover.go is 726 lines of framed handoff protocol (hello/listener/state/pools/pipe/conn/end/ack/commit), one fd per frame, a single commit point after which nothing can be put back.
  • pkgs/mcpx/internal/pool/handoff.go (390 lines): pool Detach refuses while calls are in flight (ErrBusy), parks every other instance, carries stdio pipes beside the JSON as raw fds.
  • pkgs/mcpx/internal/mcpclient/stdio.go: plain os.Pipe()s instead of cmd.Std*Pipe so the ends can be passed to another process; a pending buffer for a partial frame interrupted by handoff; a detached state while another process owns the pipes.
  • Costs already on record: takeover is unsupported on darwin (mcpx: takeover/upgrade/handoff unsupported on darwin; Linux-only tests break the darwin build #237); a takeover bug orphaned a removed server's upstream HTTP session (mcpx: takeover orphans a removed server's upstream HTTP session — never DELETEd, left to expire upstream #260, closed).
  • Cross-repo theme (ROADMAP.md): "Handing a running service to its successor."

Proposal (point of view)

  • Per-instance, not per-daemon: the failure unit stays one server instance; the supervisor protocol never multiplexes, so the one component that must stay trivial stays trivial.
  • Byte pump, not frame proxy, in v1: framing stays in the daemon's existing StdioTransport reader (one home for the partial-frame logic). Child output produced while no daemon is attached goes to a bounded supervisor buffer; overflow keeps the tail and reports the dropped byte count on attach — loss visible, never silent.
  • Same binary re-exec (pattern already used by internal/cli/explore.go and the takeover successor path), not a second artifact: mcpx ships as one Nix package.
  • Alternatives that lose, with reasons, are in the design doc: keep improving the handoff; one supervisor for all children; delegate to systemd/launchd (portability — the mcpx: takeover/upgrade/handoff unsupported on darwin; Linux-only tests break the darwin build #237 wound); separate supervisor binary.

Phased breakdown

  1. Phase 1 — supervised transport behind a flag. Hidden mcpx supervise subcommand; supervised mcpclient transport with the same interface; per-server opt-in flag, default off. Defining test: SIGKILL the daemon mid-session, start a new one — child PID unchanged, next call succeeds. (Filed as a sub-issue of this design issue and enqueued for triage.)
  2. Phase 2 — takeover becomes attach for supervised instances. Successor attaches via state-dir scan; no kindPipe/pools frames for supervised instances; listeners/HTTP keep the existing handoff. E2E supervised variant of internal/e2e/takeover_test.go asserting no pipe frames + PID continuity. (Not filed yet — its exact diff depends on Phase 1's socket protocol as built.)
  3. Phase 3 — supervised by default + lifecycle hygiene. Adopt-or-reap scan on daemon start, mcpx restart through the supervisor, protocol-version refusal surfaced in status, darwin build/test parity shrinking mcpx: takeover/upgrade/handoff unsupported on darwin; Linux-only tests break the darwin build #237's skip list to the legacy handoff. (Not filed yet — the default-flip is part of the decision above.)

Open questions (in the design doc, deliberately not filed as issues)

  • Buffer bound/policy for unattached child output (tail-drop vs backpressure).
  • Opportunistic supervisor refresh on binary upgrade vs protocol versioning alone.
  • Supervisor socket authentication beyond state-dir 0600 precedent (internal/daemon/sessions.go).

Non-goals

  • Cold-restart resume of upstream HTTP sessions (TODO.md item 3) — a sibling design, separable, not bundled here.
  • SSE upstream session mobility (TODO.md item 2); ExecIdentity semantics (TODO.md item 4) — unchanged.

Related

  • mcpx: takeover/upgrade/handoff unsupported on darwin; Linux-only tests break the darwin build #237 (darwin takeover tests), mcpx: takeover orphans a removed server's upstream HTTP session — never DELETEd, left to expire upstream #260 (closed; takeover orphan), mcpx: decide how downstream flakes consume mcpx (sub-flake or the root flake) #308/mcpx: re-home the open mcpx backlog from dezren39/nix, with this repo as the single source #309 (mcpx single-source), Design architect: a scheduled per-repo design function with a central potential-projects register #1351 (design-architect job)
  • Files: pkgs/mcpx/TODO.md, planning/roadmaps/mcpx.md, pkgs/mcpx/internal/daemon/takeover.go, pkgs/mcpx/internal/pool/handoff.go, pkgs/mcpx/internal/mcpclient/stdio.go

Acceptance criteria

  • The decision in the first line is recorded on this issue (adopt the per-instance supervisor, or keep investing in the takeover handoff), with the decider named.
  • If adopted: implementation issues exist for each phase (supervisor subcommand + attach protocol; stdio instances migrated; takeover handoff retired for stdio), each with its own acceptance criteria, and this design issue links them.
  • If not adopted: the rationale is recorded here and pkgs/mcpx/TODO.md item 1 / the roadmap entry are updated to match, so the design thread does not stay dangling.
  • No code changes land under this design issue itself.

Sub-issues

Collapse Sub-issuesSub-issues

2 of 32 of 3 Issues completed
Loading 3 sub-issues

Activity

Next
  1. dezren39
    added
    status/needs-triageNot yet triaged; needs a first look
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    priority/normalOrdinary priority (the default)
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    developing-todayBot
    on Oct 27, 2026 – with developing.today
    Contributor
    More actions

    CODE-478

  3. dezren39
    added
    epicMeta-issue grouping multiple items (org Project Type=Epic)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    source/design-architectFiled by the repo design architect job
    on Oct 27, 2026
  4. github-actions
    assigned
    dezren39
    on Oct 27, 2026
  5. dezren39
    added a sub-issue on Oct 27, 2026
    • mcpx: Phase 1 of #1384 — supervised stdio transport behind a flag (supervisor owns the child's pipes) #1385
  6. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: design architect (repo-design-architect-code job)
    • Session / ID: repo-design-architect-code cron run, 2026-10-27 04:28 CDT
    • Found via: filed this run
    • Task: Originated this design from pkgs/mcpx/TODO.md item 1 + planning/roadmaps/mcpx.md (Next, supervisor, idea); deduped against open/closed issues (nearest: mcpx: takeover/upgrade/handoff unsupported on darwin; Linux-only tests break the darwin build #237, mcpx: takeover orphans a removed server's upstream HTTP session — never DELETEd, left to expire upstream #260). Design doc: files/designs/code-mcpx-stdio-supervisor.md in the keep-the-four-repos-healthy goal workspace; registered in files/potential-projects.md.
    • Expectation: effort/l overall; awaits Drew's direction decision (stated in one line at the top of the body — hence user/review). Phase 1 is filed as sub-issue mcpx: Phase 1 of #1384 — supervised stdio transport behind a flag (supervisor owns the child's pipes) #1385 and enqueued for triage; Phases 2–3 stay in the design doc until Phase 1 lands / the decision is made.
    • Links: design doc + register (goal workspace, above); Phase 1: mcpx: Phase 1 of #1384 — supervised stdio transport behind a flag (supervisor owns the child's pipes) #1385
  7. dezren39
    added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 27, 2026
  8. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    Intake review

    Related: pkgs/mcpx/TODO.md item 1 and planning/roadmaps/mcpx.md (the design thread this issue formalizes); #237 (takeover unsupported on darwin) and #260 (takeover orphaned-session bug) are the recorded costs of the status quo. Full design doc is in the fleet goal workspace (files/designs/code-mcpx-stdio-supervisor.md).

    Notes: the issue is well-formed — evidence is file:line grounded (takeover.go, handoff.go, stdio.go) and the decision is stated in one line at the top, which is why it carries user/review. This is a design/decision item, not an implementation task.

    Risks: a supervisor per instance adds a long-lived process per stdio server; the v1 byte-pump scope is the right constraint to keep it trivial.

    Suggested approach: Drew/Muse decision first; on adoption, file the phase implementation issues in the same pass (per the fleet rule that a design never sits without an implementation link).

    — fleet monitor intake enrichment, 2026-10-27.

  9. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    Decision recorded — Drew, 2026-10-27

    Adopt the per-instance mcpx supervisor design. Drew approved it in the main chat (2026-10-27 ~13:04 CDT): "yes supervisor if that's the more sophisticated approach has strong advantages."

    Direction:

    • The stdio half of the takeover handoff is replaced by one supervisor per stdio instance (the mcpx binary re-executed as mcpx supervise), owning each child's pipes for the child's whole lifetime and outliving the daemon.
    • Phases 2–3 proceed with the supervisor as the default, per this issue's design.
    • Stop investing in the takeover handoff for stdio; the HTTP half is unaffected by this decision.

    This unblocks the gated mcpx tasks #1463, #1483, and #1484. The user/review label is removed with this comment — the decision the review was waiting on is made.

  10. 42 remaining items

  11. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 17, 2026
  12. dezren39 commented on Nov 19, 2026

    @dezren39
    dezren39
    on Nov 19, 2026
    MemberAuthor
    More actions

    Program tending — epic completion (tracking: #1352)

    • Child progress: 4 of 4 children closed (0 open).
    • Last movement: 2026-11-17T01:46:28Z.
    • All recorded children are closed. Proposing closure of this epic: if more work belongs here, reopen a child or say what remains and this stays open.
  13. dezren39
    removed their assignment
    on Nov 20, 2026
  14. dezren39
    added a commit that references this issue on Nov 26, 2026

    mcpx: restore supervised stdio as the default (#9963)

    001efa9
  15. dezren39 commented on Nov 26, 2026

    @dezren39
    dezren39
    on Nov 26, 2026
    MemberAuthor
    More actions

    Program tending — epic completion (tracking: #1352)

    • Child progress: 4 of 4 children closed (0 open).
    • Last movement: 2026-11-26T18:16:44Z.
    • All recorded children are closed. Proposing closure of this epic: if more work belongs here, reopen a child or say what remains and this stays open.
  16. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 26, 2026 – with developing.today fleet
    Contributor
    More actions

    agent-note:v1
    event: triaged
    task: 24948 (repo-health-code-pilot, lane oc-code-05, coverage reconciliation)
    verdict: #1384 stays OPEN. Not a small fix: no code change is needed here. Phase 1 (#1385) and Phase 2 are closed, Phase 3 PR #10767 merged, and the remaining open work is #9963, which needs Darwin runtime verification of #237 (existing blocked task 17495 waits on a Darwin runner). Related open defect #15407 (darwin supervisor socket path length, changed-server child retirement) is tracked separately.
    next: when the Darwin check passes, close #9963, then close #1384. No new queue task is filed; the existing follow-up owns the remaining work.

  17. dezren39 commented on Nov 27, 2026

    @dezren39
    dezren39
    on Nov 27, 2026
    MemberAuthor
    More actions

    agent-note:v1 — xaltha lane, hourly work-loop 2026-11-26 18:41 CST, queue task 25451 (triage follow-on from 24948)

    Triage verdict — #1384 stays OPEN; remainder is covered and blocked on #15407, not on a decision

    Fresh claim-check this run (2026-11-27T00:49Z claim):

    • Decision: ADOPTED and recorded here 2026-10-27 (comment 6449925704, Drew). Acceptance item 1 met; no owner decision remains.
    • Sub-issues (API readback this run): mcpx: Phase 1 of #1384 — supervised stdio transport behind a flag (supervisor owns the child's pipes) #1385 Phase 1 CLOSED, mcpx: Phase 2 of #1384 — takeover becomes attach for supervised stdio instances #9962 Phase 2 CLOSED, mcpx: Phase 3 of #1384 — supervised stdio by default + lifecycle hygiene #9963 Phase 3 OPEN — so the program-tending "4 of 4 children closed" notes do not match the sub-issue record; mcpx: Phase 3 of #1384 — supervised stdio by default + lifecycle hygiene #9963 is the live remainder.
    • mcpx: Phase 3 of #1384 — supervised stdio by default + lifecycle hygiene #9963 criteria 1–3 are met on main (PR feat(mcpx): supervised stdio by default + adopt-or-reap + restart through supervisor (#9963) #10767, plus PR mcpx: restore supervised stdio as the default (#9963) #15398 merged 2026-11-26 restoring supervised-by-default with per-instance socket keying and stop-reaping). Criterion 4 (darwin skip list) is partial: PR test(mcpx): shrink darwin skip list to legacy-handoff tests (#15397) #15414 shrank the list; 2 e2e takeover tests remain skipped, explicitly blocked on mcpx darwin: supervised takeover defects — supervisor socket path exceeds darwin limit; changed server's child not retired #15407.
    • Blocker mcpx darwin: supervised takeover defects — supervisor socket path exceeds darwin limit; changed server's child not retired #15407 is already PR'd and claimed by that work, not duplicated here: PR mcpx: shorten supervisor socket path for darwin 104-byte limit (#15407) #15550 (branch sweep/15407-sup-socket, head a6d9f96) is OPEN, mergeable/clean, but its Darwin acceptance run 45895786817 FAILED both tests (scoped child not adopted, pid -> 0; changed server's old child still running). Merge-watch task 24424 is parked until the PR head changes or a Darwin run passes on a new head. Pushing a competing fix or taking over that branch from this triage lane would duplicate live work.
    • No code changes land under this design issue itself (acceptance item 3) — none were made.

    Next / resume condition (not a person): when PR #15550's head changes and a Darwin run of TestClientLeaseSurvivesDaemonTakeover + TestTakeoverRestartsAChangedServerAndKeepsTheRest passes, #15407 lands, the 2 tests unskip, #9963 closes, and then this epic closes. Queue task 25451 is parked on that condition.

  18. developing-today-fleet
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 28, 2026
  19. dezren39
    added
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 28, 2026
  20. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 28, 2026 – with developing.today fleet
    Contributor
    More actions

    Lane 0937-D (alpha DRIVE 2026-11-28) fresh re-check, concurring with 0837-E: gate unchanged. All 20 comments on #1384 read (newest 2026-11-27T00:53:10Z). Firsthand this run: #9963 OPEN (unchanged since 2026-11-27T01:21:20Z), #15407 OPEN (unchanged since 2026-11-26T23:11:03Z), PR #15550 OPEN at the same head a6d9f96 (CLEAN/MERGEABLE) whose darwin acceptance already failed — no new head, so no new verification is possible. #1384 has no held/user/* label; its close is gated on #9963. Queue task 25451 re-parked with ready condition issue_closed #9963. Wake: #9963 closes (darwin verification passes / PR #15550 lands on a new head), then close #1384.

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/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)epic/mcpx-platformReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobstatus/in-progressQueue worker lifecycle statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

    Type

    No type

    Projects

    No projects

      Milestone

      • mcpx platform programNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.