{"record":{"id":"ad58d74d37fc7a79","repo":"can1357/oh-my-pi","slug":"instruction-reference-is-required-for-remove-instr","errorCode":null,"errorMessage":"instruction_reference is required for remove_instruction_breakpoint","messagePattern":"instruction_reference is required for remove_instruction_breakpoint","errorType":"validation","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/debug.ts","lineNumber":862,"sourceCode":"\t\t\t\tif (!params.instruction_reference) {\n\t\t\t\t\tthrow new ToolError(\"instruction_reference is required for set_instruction_breakpoint\");\n\t\t\t\t}\n\t\t\t\tconst response = await dapSessionManager.setInstructionBreakpoint(\n\t\t\t\t\tparams.instruction_reference,\n\t\t\t\t\tparams.offset,\n\t\t\t\t\tparams.condition,\n\t\t\t\t\tparams.hit_condition,\n\t\t\t\t\tcombinedSignal,\n\t\t\t\t\ttimeoutSec * 1000,\n\t\t\t\t);\n\t\t\t\tdetails.snapshot = response.snapshot;\n\t\t\t\tdetails.instructionBreakpoints = response.breakpoints;\n\t\t\t\treturn result.text(formatInstructionBreakpoints(response.breakpoints)).done();\n\t\t\t}\n\t\t\tcase \"remove_instruction_breakpoint\": {\n\t\t\t\trequireCapability(\"supportsInstructionBreakpoints\", \"instruction breakpoints\");\n\t\t\t\tif (!params.instruction_reference) {\n\t\t\t\t\tthrow new ToolError(\"instruction_reference is required for remove_instruction_breakpoint\");\n\t\t\t\t}\n\t\t\t\tconst response = await dapSessionManager.removeInstructionBreakpoint(\n\t\t\t\t\tparams.instruction_reference,\n\t\t\t\t\tparams.offset,\n\t\t\t\t\tcombinedSignal,\n\t\t\t\t\ttimeoutSec * 1000,\n\t\t\t\t);\n\t\t\t\tdetails.snapshot = response.snapshot;\n\t\t\t\tdetails.instructionBreakpoints = response.breakpoints;\n\t\t\t\treturn result.text(formatInstructionBreakpoints(response.breakpoints)).done();\n\t\t\t}\n\t\t\tcase \"data_breakpoint_info\": {\n\t\t\t\trequireCapability(\"supportsDataBreakpoints\", \"data breakpoints\");\n\t\t\t\tif (!params.name) {\n\t\t\t\t\tthrow new ToolError(\"name is required for data_breakpoint_info\");\n\t\t\t\t}\n\t\t\t\tconst response = await dapSessionManager.dataBreakpointInfo(\n\t\t\t\t\tparams.name,","sourceCodeStart":844,"sourceCodeEnd":880,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/debug.ts#L844-L880","documentation":"The remove_instruction_breakpoint action throws this ToolError when params.instruction_reference is missing. Removing an instruction breakpoint requires the same instruction address reference used to set it. Validation guard before the DAP removeInstructionBreakpoint request.","triggerScenarios":"Calling action=remove_instruction_breakpoint without instruction_reference or with an empty value.","commonSituations":"Caller only remembers the offset but not the base reference; assumes removal by index/offset alone; instruction breakpoints were set in a different session so the reference is unknown.","solutions":["Pass the exact instruction_reference used when the breakpoint was set","List current instruction breakpoints (via snapshot/breakpoint listing) and copy the reference from there","If unsure of the address, disassemble around the region to recover the instructionAddress"],"exampleFix":"// before\nawait debugTool.run({ action: 'remove_instruction_breakpoint', offset: 4 });\n// after\nawait debugTool.run({ action: 'remove_instruction_breakpoint', instruction_reference: '0x00400a1b' });","handlingStrategy":"validation","validationCode":"if (typeof params.instruction_reference !== 'string' || params.instruction_reference.length === 0) {\n  throw new Error('remove_instruction_breakpoint needs instruction_reference');\n}","typeGuard":"function hasInstructionReference(p) {\n  return typeof p === 'object' && p !== null\n    && typeof (p as { instruction_reference?: unknown }).instruction_reference === 'string'\n    && (p as { instruction_reference: string }).instruction_reference.length > 0;\n}","tryCatchPattern":"try {\n  await debugTool.run({ action: 'remove_instruction_breakpoint', ...params });\n} catch (err) {\n  if (err instanceof ToolError && err.message.includes('instruction_reference is required')) {\n    // list current instruction breakpoints to recover the reference, then retry\n  } else throw err;\n}","preventionTips":["Store the instruction_reference returned/used at set time for later removal","Do not attempt removal by offset alone","Keep references session-scoped; re-derive them after a debug session restart"],"tags":["debug","dap","parameter-validation","instruction-breakpoint"],"backgroundTag":"missing-required-parameter","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}