Standalone CLI reports a paused session after its adapter exits during navigation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Read src/cli/dapClient.ts around the process-exit callback and src/cli/cliDebuggingExecutor.ts around the terminated callback and runThreadCommand error path. Trace how a rejected next or continue request can restore an older stopped state after adapter exit. Use the linked synthetic-adapter harness to check that abrupt exits leave get_debug_status at no-session, while live request rejections preserve the paused session.
Written by the indexing model from the issue text.
Description
Summary
When a standalone debug adapter exits while a step or continue request is
pending, the navigation call correctly returns an adapter-exit error. The next
get_debug_status nevertheless reports an active, paused session, even though
the adapter process is gone.
A rejected navigation request from an adapter that remains alive should preserve
the paused session. An adapter process exit should instead leave no active
session. The reproduction distinguishes these two outcomes.
Environment
- DebugMCP source commit:
d0b4a334a6a3d8d600c5aa75ec60d9de272af3c4. - Verified baseline: Windows x64, Node.js 24.22.1, compiled
out/modules. - The root extension manifest at this commit reports version 2.4.4; this is not
a claim about an installed or published standalone npm package version. - A bounded synthetic Node DAP adapter over standard input/output; no language
debugger, VS Code debug session or real debuggee is started.
Reproduction steps
-
In a writable working directory, create a separate upstream checkout and build the reviewed revision. The commands use PowerShell:
$debugMcpRoot = Join-Path (Get-Location) 'DebugMCP-review-target' git clone https://github.com/microsoft/DebugMCP.git $debugMcpRoot git -C $debugMcpRoot checkout d0b4a334a6a3d8d600c5aa75ec60d9de272af3c4 Push-Location $debugMcpRoot npm ci --ignore-scripts npm run compile Pop-Location -
Obtain the reproduction project from its default main branch and run the test against that separate upstream checkout:
$reproRoot = Join-Path (Get-Location) 'debugmcp-review-repro' git clone https://github.com/hahnfk/debugmcp-repro.git $reproRoot Push-Location $reproRoot node scripts/review/cli-adapter-exit-navigation.cjs --debugmcp-root $debugMcpRoot Pop-LocationReproduction sources and evidence:
-
The test creates a fresh production
CliDebuggingExecutorand
DebuggingHandlerfor each scenario. Their realDapClientstarts the
fixture as a child process and performs the DAP initialization and launch
sequence. The fixture reports a breakpoint stop. The test confirms the
public status is active and paused and reads the fixture's process ID and
per-run marker through a public evaluation request. -
For
step_over, the handler sends DAPnext. The fixture immediately calls
process.exit(23)with that request still pending. It sends no response,
exitedevent orterminatedevent. The actualDapClientchild-process
exit path rejects the pending request. -
After receiving the navigation error, confirm that the fixture process is
absent and call the publicget_debug_statushandler. -
Repeat with
continue_execution, which sends DAPcontinue. Each case uses
a fresh executor so no previous-session startup state is involved.
The test also runs four controls: live adapters rejecting next and continue
with success:false, a normal step to a new stop, and a normal continue through
program completion. All six initial launches must succeed.
The default regression command exits nonzero on the reviewed commit. To require
the exact current bug, all positive controls and successful cleanup, use:
node (Join-Path $reproRoot 'scripts/review/cli-adapter-exit-navigation.cjs') --debugmcp-root $debugMcpRoot --expect-current-bug
An arbitrary startup failure, navigation timeout, or live adapter's ordinary
request rejection does not count as reproducing this adapter-exit bug.
Expected result
Both abrupt-exit cases should return the adapter-exit error from navigation.
Afterward, get_debug_status should report:
{
"status": "no-session",
"sessionActive": false,
"paused": false
}
For comparison, a live adapter's rejected request should preserve its active,
paused session, and the adapter should still answer a fixture-identity request.
Normal step and continue operations should retain their usual behavior.
Actual result
Navigation reports an error containing:
Debug adapter exited with exit code 23
The fixture process is absent. Nevertheless, the subsequent public status is:
{
"status": "paused",
"sessionActive": true,
"paused": true
}
The stale active-session result occurs for both next and continue. The
live-rejection and normal-navigation controls behave as expected. Process and
session IDs in the emitted JSON are observations from each local run, not
constants that other users must reproduce.
Cause
The production
DapClient process-exit callback
rejects pending requests and synchronously emits the client exit event. The
executor's
terminated callback
therefore marks the session terminated and clears its thread/frame context.
When the rejected navigation request resumes its asynchronous error path,
runThreadCommand restores previousState,
overwriting that newer termination with the old stopped state. The status
request then treats the dead adapter's session as active and paused.
Restoring the previous paused state is appropriate for the live-rejection
controls. It should not replace a newer adapter-exit state.
Scope and test seams
This is a standalone-executor lifecycle report. The reproduction uses the actual
compiled executor, handler and DAP-client implementations. It does not write
their private fields or replace their methods. Test seams are the synthetic DAP
peer, a deterministic configuration-manager double, the shared loader's inert
vscode import, and a quiet logger sink.
The fixture starts no debuggee and exits on closed input or its own ten-second
deadline. The harness has a separate twenty-second deadline. Normal cleanup uses
executor.dispose() and the production DAP client's owned child-process handle;
PID checks are read-only, and historical process IDs are never kill targets.
The JSON reports the tested commit, Node version, source/compiled-module hashes,
all controls and fixture-process cleanup. A rebuilt local fix can be tested with
the normal regression oracle; sourceDirty remains visible in its output.
Related reports
Issue #161 and merged
PR #162 address breakpoint
synchronization between sessions by resetting adapter initialization. This case
concerns an in-flight navigation request restoring stale execution state after
an actual adapter process exit.
Investigation tooling
This investigation and its reproduction work were carried out with assistance
from OpenAI Codex.
- Codex desktop app version:
26.1021.31345(build21828). - Version verified on
2026-10-25, when this tooling disclosure was added.
The automated reproduction runs directly as an isolated Node.js harness against
the DebugMCP implementation. Codex assisted the investigation, harness authoring
and report preparation.
- Dominant language
- TypeScript
- Stars
- 580
- Forks
- 63
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/DebugMCP
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 56/100
Maintainers usually reply within 1 day
All issues in microsoft/DebugMCP
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
shoelace-style/webawesome#2979 ·
Maintainers usually reply within 1 day
-
Chip source filter and denial markers miss Storage rows when a Storage activity source is pickedOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
omdsh-dev/DSH-better-sidebar#1141 ·
Maintainers usually reply within 2 days