microsoft / microsoft/DebugMCP

Debug session becomes unsynchronized during long `step_over` and cannot be stopped

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
511
Forks
60
Avg merge
2d 1h
Merged PRs (30d)
18

Description

I’m seeing inconsistent behavior when DebugMCP handles long-running operations during step_over.

Scenario 1 – Function with sleep

demo_run.py

from utils import demo

def main() -> None:
    print('Start')
    demo()
    print('End')

if __name__ == "__main__":
    main()

utils.py

from time import sleep

def demo():
    sleep(100)
    print('in demo')

Failure Behavior:

When execution reaches demo() and sleep(100) is still running, step_over fails with:
Debug session is not ready. Please wait for initialization to complete.
Attempting stop_debugging afterward fails with:
No active debug session to stop

In the end the debug session is still running and must be terminated manually.

Scenario 2 – Sleep inside main

from time import sleep

def main() -> None:
    print('Start')
    sleep(100)
    print('End')

if __name__ == "__main__":
    main()

Result: step_over times out while sleep(100) is still executing, and the agent later fails to stop debugging.


Issues:

  1. step_over times out or reports invalid session while code is still executing.
  2. stop_debugging fails to terminate an active session after such errors.

Expected Behavior:

  • Long-running execution should not invalidate the session.
  • step_over should wait or return a clear "execution in progress" state.
  • stop_debugging should reliably stop any active session.

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the issue with the provided demo_run.py and utils.py scenarios, then trace the step_over and stop_debugging entry points through session state and timeout handling. Done means long-running sleep calls do not invalidate the session, step_over reports a clear in-progress state or waits, and stop_debugging terminates the active session.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.