Debugger Integration
CodeBuddy interacts with any debugger via the Debug Adapter Protocol (DAP). Start a debug session normally (F5 or Run and Debug), and the agent gains tools to inspect threads, walk stack frames, evaluate expressions, and control execution — from the chat.
Works with any DAP debugger: Node.js, Python, Go, Java, C++, Rust, etc. The debugger subagent has exclusive access to these tools.
The debug tools
Section titled “The debug tools”The agent gets five DAP tools:
| Tool | Effect |
|---|---|
debug_get_state | Get the current debug session state, including all threads |
debug_get_stack_trace | Return the stack trace for a given thread |
debug_get_variables | Read variables for a scope/frame (via variablesReference) |
debug_evaluate | Evaluate an expression in the context of a stack frame |
debug_control | Control execution — action: stepOver, stepInto, stepOut, continue, pause |
Example flow
Section titled “Example flow”You: "The function returns null instead of the expected array. Debug it."
Agent: I'll inspect the active debug session. debug_get_state → Thread 1 (paused at breakpoint) debug_get_stack_trace {threadId: 1} → Frame 0: processItems() at src/handler.ts:42 debug_get_variables {variablesReference: 1001} → items = undefined, config = {...}
`items` is undefined at line 42. `fetchItems()` on line 38 likely returned nothing. debug_evaluate {expression: "typeof fetchItems", frameId: 0} → "function" debug_evaluate {expression: "fetchItems()", frameId: 0} → undefined
Root cause: `fetchItems()` returns nothing when the cache is empty.Limitations
Section titled “Limitations”- Requires an active debug session — the agent can’t start one.
- DAP custom requests depend on the specific debug adapter — some may not support all actions.
debug_evaluateruns in REPL context — side effects possible.