Skip to content

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 agent gets five DAP tools:

ToolEffect
debug_get_stateGet the current debug session state, including all threads
debug_get_stack_traceReturn the stack trace for a given thread
debug_get_variablesRead variables for a scope/frame (via variablesReference)
debug_evaluateEvaluate an expression in the context of a stack frame
debug_controlControl execution — action: stepOver, stepInto, stepOut, continue, pause
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.
  • 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_evaluate runs in REPL context — side effects possible.
  • Subagents — the debugger role that owns these tools
  • Tools — the 5 debug tools in the full list