Skip to content

session tree M1: Python child debugging by default and cross-platform lifecycle fixes (#1081, #1089) - #1091

Merged
debugmcpdev merged 9 commits into
mainfrom
feat/1081-m1-default-on
Nov 5, 2026
Merged

debugmcpdev merged 9 commits into
mainfrom
feat/1081-m1-default-on

Conversation

@debugmcpdev

@debugmcpdev debugmcpdev commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Python launches now debug child processes by default. Children become sessions with parentSessionId, inherit breakpoints, and report stops through the parent's wait_for_stop.

Behavior

  • Send subProcess: true unless dapLaunchArgs.subProcess explicitly overrides it. An explicit false keeps children undebugged and produces a diagnostic; explicit true is silent.
  • Preserve the per-tree limit, DEBUG_MCP_MAX_CHILD_SESSIONS (default 32; 0 releases all reported children).
  • A by-port attach target decides subprocess debugging at listen time. The attach request forwards subProcess, but an explicit false now explains that disabling child debugging requires the target's --configure-subProcess false or debugpy.configure(subProcess=False).
  • Update tool descriptions, snapshots, docs, the debugging skill, and release fragments to describe the default.

Lifecycle coverage and fixes

  • Exercise child and parent termination, grandchildren, subtree close, siblings, restart, attach-root close/detach, multiprocessing, and pytest-xdist workers against real debugpy. Add hash-pinned pytest-xdist to CI requirements.
  • Synchronize attach tests with a parent breakpoint before spawning. Verify the wait identifies that parent before continuing it; this also keeps opt-out targets alive through attach verification.
  • Allow Python's POSIX resource-tracker sibling while verifying the intended multiprocessing worker's breakpoint, locals, and completion.
  • Track attach targets before readiness, handle spawn errors, close sessions on setup failure, and await drained output before asserting target completion.
  • Fix the existing Windows Dart/.NET bridge cleanup race (bridge-tree-kill.test.ts flakes on Windows: one survivor when taskkill loses the 300 ms race to the plain kill (#937 follow-up) #1089) exposed during validation: wait for the tree-termination command to finish before a direct-child fallback can orphan descendants. Bound a stuck command and preserve exited-child and duplicate-cleanup protections.

Scope

Closes #1081 and #1089. Ancestor/descendant idle protection remains in #1025 step 2; session-tree M2 is #1082. The pytest preset retains its in-process default; xdist coverage uses a module launch.

Validation

  • Full pre-push gate passed: lint, source/test type checks, clean build, 8,091 unit tests passed (5 skipped), 138 integration tests passed (1 skipped).
  • Python suites use the repository-pinned debugpy 1.8.22 and pytest dependencies.
  • Both real Windows bridge tree-termination tests and all 37 bridge unit tests passed.
  • Documentation, changelog, personal-path checks, and git diff --check passed.
  • GitHub CI passed on 3d0a17fc917c9c57a32de285f0e0a3c765117b64: full Linux/Windows suites with coverage, Windows Python focus, MCP conformance, container tests, and all language host lanes. CodeQL and patch coverage also passed.

cynarlab and others added 7 commits November 4, 2026 21:00
… are child sessions unless a launch opts out (#1081)

The launch transform sends subProcess: true unless dapLaunchArgs names it (the false default of #1008 existed only for the park hang the session tree removed); an explicit false is forwarded with a note that the children run undebugged. The attach transform sends the same for the record: measured against python -m debugpy --listen, the target decides at listen time (on unless --configure-subProcess false), and its children report on this connection whatever the request says, so an explicit false gets a note saying so.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…at exits early, siblings and a multiprocessing child; the default-on and opt-out proofs (#1081)

The inherit regression (#993) now proves the default: its child is a child session that ran to its end, and an explicit subProcess: false runs it undebugged with the note. The tree suite drops its explicit key and its release-run case (the inherit default case).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ng under a paused parent, a parent exiting early, a grandchild chain closed under its child, siblings, multiprocessing (#1081)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…orts on the attach connection whatever the request says; detach keeps the rows, close removes them, the target runs on (#1081)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… yields two, the worker stops on the breakpoint, the run completes; xdist joins the hashed pytest lock and the Windows lane runs the new suites (#1081)

requirements/pytest.txt recompiled with pip-compile from pytest.in (+ pytest-xdist==3.8.0, execnet==2.1.2; every existing hash unchanged).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…atus, the measured by-port attach, the KNOWN_ISSUES entry dropped, the changed entry (#1081)

The wait_for_stop description's parenthetical says "(Python, on by default)" (24 tool-list snapshots); the two unreleased #1081 added fragments stop saying the default is off; the pytest preset's comment says why -p no:xdist stays.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…843 guard)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: JF <john.franklin@gmail.com>
Signed-off-by: JF <john.franklin@gmail.com>
@debugmcpdev debugmcpdev changed the title session tree M1 (3/3): Python child processes are debugged by default — the attach measurement, the xdist, grandchild and cascade suites (#1081) session tree M1: Python child debugging by default and cross-platform lifecycle fixes (#1081, #1089) Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.59155% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...adapter-dotnet/src/utils/netcoredbg-bridge-core.ts 96.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@debugmcpdev debugmcpdev left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the runtime defaults, attach diagnostics, child-session lifecycle, fixtures, and platform behavior. Fixed the attach synchronization/cleanup defects and the POSIX multiprocessing assertion in 6d564ec. Full validation also reproduced #1089; 3d0a17f fixes the Windows Dart/.NET tree-termination race and adds six regression cases.

No outstanding review findings on this revision. The full local gate passed (8,091 unit tests, 138 integration tests), and GitHub CI, CodeQL, and patch coverage are green for this exact head.

@debugmcpdev
debugmcpdev merged commit 28b326a into main Nov 5, 2026
15 checks passed
@debugmcpdev
debugmcpdev deleted the feat/1081-m1-default-on branch November 5, 2026 11:23
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 M1: Python children as debug sessions — debugpy startDebugging adoption, parentSessionId, tree-aware wait_for_stop (#1005 part B)

2 participants