{"record":{"id":"076126f9b9d10327","repo":"can1357/oh-my-pi","slug":"remove-breakpoint-requires-file-line-or-function","errorCode":null,"errorMessage":"remove_breakpoint requires file+line or function","messagePattern":"remove_breakpoint requires file\\+line or function","errorType":"validation","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/debug.ts","lineNumber":829,"sourceCode":"\t\t\t\t\ttimeoutSec * 1000,\n\t\t\t\t);\n\t\t\t\tdetails.snapshot = response.snapshot;\n\t\t\t\tdetails.breakpoints = response.breakpoints;\n\t\t\t\treturn result.text(formatBreakpoints(response.sourcePath, response.breakpoints)).done();\n\t\t\t}\n\t\t\tcase \"remove_breakpoint\": {\n\t\t\t\tif (params.function) {\n\t\t\t\t\tconst response = await dapSessionManager.removeFunctionBreakpoint(\n\t\t\t\t\t\tparams.function,\n\t\t\t\t\t\tcombinedSignal,\n\t\t\t\t\t\ttimeoutSec * 1000,\n\t\t\t\t\t);\n\t\t\t\t\tdetails.snapshot = response.snapshot;\n\t\t\t\t\tdetails.functionBreakpoints = response.breakpoints;\n\t\t\t\t\treturn result.text(formatFunctionBreakpoints(response.breakpoints)).done();\n\t\t\t\t}\n\t\t\t\tif (!params.file || params.line === undefined) {\n\t\t\t\t\tthrow new ToolError(\"remove_breakpoint requires file+line or function\");\n\t\t\t\t}\n\t\t\t\tconst file = resolveToCwd(params.file, this.session.cwd);\n\t\t\t\tconst response = await dapSessionManager.removeBreakpoint(\n\t\t\t\t\tfile,\n\t\t\t\t\tparams.line,\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.breakpoints = response.breakpoints;\n\t\t\t\treturn result.text(formatBreakpoints(response.sourcePath, response.breakpoints)).done();\n\t\t\t}\n\t\t\tcase \"set_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 set_instruction_breakpoint\");\n\t\t\t\t}\n\t\t\t\tconst response = await dapSessionManager.setInstructionBreakpoint(","sourceCodeStart":811,"sourceCodeEnd":847,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/debug.ts#L811-L847","documentation":"The debug tool's remove_breakpoint action throws this ToolError when neither file+line nor a function name is provided. The tool must know which breakpoint location to remove; without a locator it refuses to call the DAP session manager. Pure input-validation guard.","triggerScenarios":"Calling action=remove_breakpoint with params.file empty/missing or params.line undefined and no function alternative supplied.","commonSituations":"Caller tries to clear all breakpoints by passing no fields (use a clear-all action instead); line number lost when echoing back breakpoint info; function name vs source location mismatch.","solutions":["Provide the same file+line used when the breakpoint was set","Or provide the function name if the breakpoint was set as a function breakpoint","List existing breakpoints first and echo back their exact file/line"],"exampleFix":"// before\nawait debugTool.run({ action: 'remove_breakpoint' });\n// after\nawait debugTool.run({ action: 'remove_breakpoint', file: 'src/index.ts', line: 42 });","handlingStrategy":"validation","validationCode":"function canRemoveBreakpoint(params) {\n  return (typeof params.file === 'string' && params.file.length > 0 && Number.isInteger(params.line))\n    || (typeof params.function === 'string' && params.function.length > 0);\n}\nif (!canRemoveBreakpoint(params)) throw new Error('remove_breakpoint needs file+line or function');","typeGuard":"function hasBreakpointLocation(p) {\n  return typeof p === 'object' && p !== null\n    && (typeof (p as { file?: unknown }).file === 'string'\n      && typeof (p as { line?: unknown }).line === 'number'\n      || typeof (p as { function?: unknown }).function === 'string');\n}","tryCatchPattern":"try {\n  await debugTool.run({ action: 'remove_breakpoint', ...params });\n} catch (err) {\n  if (err instanceof ToolError && err.message.includes('requires file+line or function')) {\n    // fetch current breakpoints and retry with an exact location\n  } else throw err;\n}","preventionTips":["Echo back the exact file/line recorded when the breakpoint was set","Track breakpoints in caller-side state keyed by location","Do not pass empty params expecting a clear-all semantic"],"tags":["debug","dap","parameter-validation","breakpoint"],"backgroundTag":"missing-required-parameter","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}