Proposal: Breakpoint management (set, unset, mute) via ACP #1412
bartvanhoutte
started this conversation in
Protocol Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
ACP currently has no way for an agent to manage breakpoints in the editor's debugger. As agents take on more autonomous debugging workflows — running code, observing failures, iterating on fixes — the ability to set, unset, and mute breakpoints becomes a natural and important capability.
The closest prior art is the Debug Adapter Protocol (DAP), which defines
setBreakpoints,setFunctionBreakpoints, andsetExceptionBreakpointsrequests. Rather than reinventing that design, ACP could expose a lightweight breakpoint management surface that complements DAP (or delegates to it in editors that already host a DAP client).Proposed capabilities
1.
setBreakpoints(source breakpoints)An agent sends a list of breakpoints for a single source file. Following DAP's semantics, this replaces the full set of breakpoints for that file (not incremental), so a simple adapter implementation can clear-and-reset.
Request (agent → client):
{ "method": "setBreakpoints", "params": { "source": { "path": "/workspace/src/server.ts" }, "breakpoints": [ { "line": 42 }, { "line": 87, "condition": "req.status === 500" }, { "line": 120, "logMessage": "reached handler: {req.method}" }, { "line": 55, "enabled": false } ] } }Key fields per breakpoint:
line(required) — 1-based line numbercolumn(optional) — for inline breakpointscondition(optional) — expression that must be truthy to pauselogMessage(optional) — log point: emit message instead of pausing (interpolated with{expr})enabled(optional, defaulttrue) —falsemeans the breakpoint is registered but mutedResponse (client → agent):
{ "breakpoints": [ { "id": 1, "verified": true, "line": 42 }, { "id": 2, "verified": true, "line": 87 }, { "id": 3, "verified": true, "line": 120 }, { "id": 4, "verified": false, "line": 55, "message": "Location not yet loaded" } ] }verified: falseindicates the editor could not confirm the breakpoint (e.g. source not yet compiled). The client should send abreakpointChangednotification when/if the state later resolves.2.
setFunctionBreakpointsBreak when a named function is entered, regardless of source location. Useful for agents that know a function name but are navigating unfamiliar code.
{ "method": "setFunctionBreakpoints", "params": { "breakpoints": [ { "name": "handleRequest" }, { "name": "DatabasePool::connect", "condition": "retries > 3" } ] } }3.
setExceptionBreakpointsControl whether execution pauses on thrown or caught exceptions.
{ "method": "setExceptionBreakpoints", "params": { "filters": ["uncaught"], "filterOptions": [ { "filterId": "caught", "condition": "error instanceof TypeError" } ] } }Available filter IDs would be declared by the client in its capabilities during
initialize.4.
breakpointChangednotification (client → agent)An unsolicited notification the client sends when a breakpoint's state changes asynchronously (e.g. after hot-reload, source map resolution, or a recompile).
{ "method": "breakpointChanged", "params": { "reason": "changed", "breakpoint": { "id": 4, "verified": true, "line": 55 } } }Design notes
enabled: falseis retained in the editor UI (typically shown greyed-out) but does not pause execution. This is distinct from removing it entirely. Passing an emptybreakpointsarray for a source clears all breakpoints for that file.initialize. Agents check capabilities before issuing these requests.Open questions
setBreakpointsbe per-file (replace semantics, as in DAP) or should there be separateaddBreakpoint/removeBreakpointmessages with delta semantics?Happy to draft an RFD if there's interest.
Beta Was this translation helpful? Give feedback.
All reactions