Skip to content

[FEATURE] No way to enable break-on-exception β€” uncaught exceptions terminate instead of pausingΒ #220

Description

@debugmcpdev

πŸš€ Feature Request

While validating #214 end-to-end we found that an uncaught exception in a Python debuggee terminates the session rather than pausing at the crash site: debugpy only breaks on exceptions when the client sends setExceptionBreakpoints with filters ('uncaught'/'raised'), and mcp-debugger never sends it for top-level sessions (only the js-debug child-session bootstrap does, with empty filters). There is also no MCP tool through which an agent could enable it.

Why it matters

Combined with #214's lastStop (now exposing reason: 'exception' when a stop occurs), break-on-uncaught is the missing half of crash diagnosis: pausing at the crash site with the traceback frame live is exactly the agent workflow β€” inspect locals at the point of failure instead of re-running with print statements.

Proposal

  • Either a dedicated tool (set_exception_breakpoints with a filters array validated against the adapter's exceptionBreakpointFilters capability), or an option on start_debugging (e.g. breakOnUncaught: true).
  • Consider defaulting uncaught on for Python launch sessions: for an agent-driven debugger, pausing at a crash is almost always more useful than losing the session β€” and after Stop reason (breakpoint vs. exception) is discarded after the first stop β€” no way to detect a crashΒ #214 the pause is clearly labeled reason: 'exception'.
  • The python adapter already validates filters in sendDapRequest('setExceptionBreakpoints', ...); the plumbing exists, only the tool surface is missing.

Repro

Set a breakpoint, start_debugging, continue_execution past a ZeroDivisionError: the session goes straight to state: 'stopped' β€” indistinguishable from a clean exit (no exit code is surfaced either).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions