Found by an osoji audit panel review (two independent adjudications agreeing, at commit 2f2782c).
Behavior
For the identical condition — a request carrying an unknown/stale sessionId — tools diverge in error envelope:
pause_execution: handlePause (src/server.ts ~L1278-1293) re-throws validateSession's plain McpError (~L276, ~L1285) → protocol-level error.
list_threads: handleListThreads (~L1295-1305) re-throws the same way (~L1302).
- Every sibling control tool (
set_breakpoint, start_debugging, step/continue: ~L812-823, ~L858-866, ~L1082-1092) and every other retrieval tool (get_variables/get_stack_trace/get_scopes: ~L1132-1141, ~L1155-1169, ~L1181-1190) converts the identical failure to a structured {success: false, error: ...} result.
Evidence it's drift, not design
The typed-error conversion branches inside handlePause/handleListThreads are dead code: SessionNotFoundError extends McpError (src/errors/debug-errors.ts ~L44) and is re-thrown one line earlier. docs/error-handling-guide.md's own continue example (~L89-97) contradicts actual behavior.
Suggested fix
Declare one envelope contract for session-not-found and align both handlers to the conversion path used by the other seven tools (the dead typed-error branches then become live).
🤖 Generated with Claude Code
Found by an osoji audit panel review (two independent adjudications agreeing, at commit 2f2782c).
Behavior
For the identical condition — a request carrying an unknown/stale
sessionId— tools diverge in error envelope:pause_execution:handlePause(src/server.ts ~L1278-1293) re-throwsvalidateSession's plainMcpError(~L276, ~L1285) → protocol-level error.list_threads:handleListThreads(~L1295-1305) re-throws the same way (~L1302).set_breakpoint,start_debugging, step/continue: ~L812-823, ~L858-866, ~L1082-1092) and every other retrieval tool (get_variables/get_stack_trace/get_scopes: ~L1132-1141, ~L1155-1169, ~L1181-1190) converts the identical failure to a structured{success: false, error: ...}result.Evidence it's drift, not design
The typed-error conversion branches inside
handlePause/handleListThreadsare dead code:SessionNotFoundErrorextendsMcpError(src/errors/debug-errors.ts ~L44) and is re-thrown one line earlier. docs/error-handling-guide.md's owncontinueexample (~L89-97) contradicts actual behavior.Suggested fix
Declare one envelope contract for session-not-found and align both handlers to the conversion path used by the other seven tools (the dead typed-error branches then become live).
🤖 Generated with Claude Code