Repository navigation
refactor(proxy): drop the in-session manager's own throwaway release — unreachable since #1094 — and refuse a second pending target by name (#1082) - #1102
Open
debugmcpdev wants to merge 2 commits into
Conversation
…— unreachable since #1094 — and refuse a second pending target by name (#1082) Since #1094 every js-debug report after the program's own is relayed as a child report before it can reach ChildSessionManager.createChildSession: the js policy does it on the root connection once a target is adopted (adapter-policy-js.ts, `context.adoptedTargets.size > 0`), and createChildSafePolicy does it on every other connection. The worker's holder adopts or releases the report (throwaway-release.ts). The manager's "cannot adopt, release undebugged" branch — #501's original lever, its `releasedTargets`, `releaseUndebugged`, `waitForReadySignal` and the 'released'/'release-failed' outcomes — therefore had no caller left: 110 lines of a second copy of the release. Removed, with its #501 unit cases (five in the manager suite, two in the client suite that pinned the client's bookkeeping on those outcomes). In its place the gate is an invariant: a second pending target reaching the manager while a child is active or being adopted is a routing bug, so the manager logs it and throws by name instead of acking it with nothing attached (which would park the process forever, the #501 failure) — MinimalDapClient's existing catch rolls the id back. Two cases pin that, and the #518 trace case keeps its adoption half. The #1082 relay cases assert that no connection is opened for a fork. No behaviour change for any reachable path; the spike notes now point at throwaway-release.ts for the lever. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015BDrn6AsHQ4rmTXFHzQkn8
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes
ChildSessionManager's own "cannot adopt → release undebugged" branch — #501's original lever — and the bookkeeping that existed only for it:releasedTargets,releaseUndebugged,waitForReadySignal, the'released'/'release-failed'outcomes, andMinimalDapClient's rollback on those outcomes (−426/+73 over 6 files). Pure refactor: no reachable path changes behaviour.Why it is unreachable
Since #1094 every js-debug
startDebuggingreport after the program's own is relayed as a child report before it can reachChildSessionManager.createChildSession:adapter-policy-js.tshandleReverseRequestreturnschildReportfor every report oncecontext.adoptedTargets.size > 0(the id is added before the first adoption runs);createChildSafePolicyreturnschildReportfor every report.The worker's holder then adopts or releases the report (
throwaway-release.ts).createChildSessionis called fromminimal-dap.tsonly (two sites), and only for the program's own first target. The manager's second copy of the release therefore had no caller left.What replaces it
An invariant: a second pending target reaching the manager while a child is active or being adopted is a routing bug, so the manager logs it and throws by name instead of acking it with nothing attached — the ack-with-nothing is exactly what parks the process forever (#501).
MinimalDapClient's existing catch rolls the id back.Tests
instanceslength 1).docs/javascript/spike-notes-forks.mdnow points atthrowaway-release.tsfor the lever.Gates run locally: the two unit files (178/178),
npm run lint,npm run typecheck:all, and the JS tree/attach/cascade/launch-config integration suites (32/32) againstbuild:ci; the pre-push hook ran the full unit and integration projects on push.No changelog fragment: pure refactor (
no-changelog).Refs #1082, #1094, #501.
🤖 Generated with Claude Code