Repository navigation
feat(mcpx): takeover becomes attach for supervised instances (#9962) - #10719
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Picked up by |
Summary
Phase 2 of #1384: a successor daemon now adopts already-running supervised stdio instances by attaching to their supervisors, instead of leaving them out of the restart story. Supervised instances still exchange no
kindPipe/poolshandoff frames (Pool.Detach already excluded them); what was missing was the successor-side adoption and PID visibility.Closes #9962.
Changes
AttachSupervised— attach-only entry point (never spawns; no socket, dead socket, or a live supervisor's refusal are all errors).dial/startLanethread an attach-only mode (dialMode/startLaneMode) that only changes the supervised branch. NewPool.AdoptRunningSupervised— the state-dir scan: for a supervised pool with no instance in the default lane, attach to the running supervisor and install the child as the pool's instance; quiet no-op when no supervisor is live, another daemon is attached, or the pool already serves the lane (no duplicates).Instance.PID()now surfaces the supervised child's PID from the attach handshake (was 0 — status could not distinguish attach from respawn).Registry.AdoptSupervisedruns the scan over all pools, called at daemon startup (Listen) and again incommitTakeoverright afterAdoption.Attach()— at startup a live predecessor may still be attached (scan no-ops); after the commit the predecessor has detached and the attach succeeds.Tests
TestTakeoverAttachesToSupervisedChild: supervised variant of the takeover test — child PID identical before/afterdaemon --takeover, calls answered through the same child, child survives the predecessor's exit. The test retires the child itself at cleanup (it outlives every daemon by design).TestTakeoverKeepsTheChildAndTheListenerand the rest of the takeover family pass unchanged (unsupervised handoff untouched).internal/pool,internal/daemon,internal/mcpclientsuites green; fullpkgs/mcpxsuite run recorded on mcpx: Phase 2 of #1384 — takeover becomes attach for supervised stdio instances #9962.Verified test-first: before the change the variant failed with the successor reporting PID 0 for the supervised instance (no adoption, PID not surfaced).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.