A resume reports `timeout` when the debug session has already ended

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, typescript

Research direction

Start with resume in src/dap/dapSession.ts, then trace the socket-close path through endWhenFinished and the stopped, terminated, and timer handling. Reproduce with the cql_debug_continue flow described in the issue, using timeoutMs: 10000, and check the documented behavior in the README and skill. Done means a closed debug session causes cql_debug_continue to return promptly with the same end-of-session result, including launch errors, rather than a timeout; add or update regression coverage for that distinction.

Written by the indexing model from the issue text.

Description

When the debug session's socket closes without a terminated event, cql_debug_continue waits for the whole timeoutMs and then returns {"event":"timeout"}. The README and the skill say a timeout means the session is still alive and paused, and that a session which ends without stopping returns a note with the launch errors. Here the session is gone: the next cql_debug_evaluate answers "debug session not active; call cql_debug_start first".

To reproduce

Step 2 of #2 is one way to get a session that ends this way. With timeoutMs: 10000 the call takes 10 seconds and returns timeout; the log line DAP session ended: socket closed appears 0.3 s after launch.

Likely cause (read)

resume in src/dap/dapSession.ts waits for stopped, terminated or the timer. A socket close is handled only in endWhenFinished, which disposes the client but does not settle a resume that is waiting.

What I expected

The resume returns at once with the same result as a session that terminated without stopping, including the launch errors, so an agent can tell "ended" from "still running".

Environment: cql-mcp 0.1.0-rc.2 (a2895f0), cql-language-server 5.0.0, Node 25.9.0, Temurin JDK 21, macOS arm64.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
1h 32m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cqframework/cql-mcp

All issues in cqframework/cql-mcp

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.