Skip to content

fix(session): retire previous run trees with their ownership - #1246

Merged
debugmcpdev merged 1 commit into
mainfrom
fix/session-tree-run-rollover
Nov 24, 2026
Merged

debugmcpdev merged 1 commit into
mainfrom
fix/session-tree-run-rollover

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Closes #1231 and #1244.

When a launch or attach replaces the run on a root session, it now retires the previous run's descendants even if a worker crash cleared every proxy handle. A subsequent wait_for_stop can no longer select an errored child from the old run. Crash evidence remains available until the caller replaces or closes the run.

Session-preserving teardown and explicit close now share the child-disconnect decision. The previous run's ownership and the adapter's close semantics determine what happens to each live process. In particular, moving from an attached run to a launch releases the external children.

Verification

  • Reproduced both defects before changing the shared teardown. Regression cases exercise replacement by launch and by attach, including a borrowed child and grandchild.
  • A probe using the real ChildProxyView and a recording transport confirmed that explicit close and replacement both send terminateDebuggee: false for borrowed Python children and true for owned Python children.
  • The focused session suites passed, as did lint, source and test type checks, clean build and packaging, the documentation check, and changelog validation. The state-machine test now samples the state at the adapter's configuration event.
  • The full local unit sweep and the integration run encountered sandbox restrictions on loopback traffic, Windows process inspection, and filesystem junctions. A separate Dart unit test also timed out. The two regressions above run locally without external toolchains. See Full personal-path audit flags two documentation URLs in the installed Windows CodeLLDB payload #1245 for unrelated false positives in the full personal-path audit of an installed Windows CodeLLDB payload.

Use the session-preserving teardown for every replacement launch and attach. Release children of the old borrowed run using the same adapter disposition as explicit close, and remove terminal descendants after a worker exit.

Signed-off-by: Codex <noreply@openai.com>
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@debugmcpdev
debugmcpdev merged commit c11ac51 into main Nov 24, 2026
16 checks passed
@debugmcpdev
debugmcpdev deleted the fix/session-tree-run-rollover branch November 24, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session tree: after the proxy worker dies, a relaunch keeps the previous run's child sessions, and the root's wait_for_stop can answer with one of them

1 participant