Skip to content

Debug session becomes unsynchronized during long step_over and cannot be stopped #29

@shlomiLan

Description

@shlomiLan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions