{"record":{"id":"7cfe74469292bd79","repo":"can1357/oh-my-pi","slug":"data-id-is-required-for-set-data-breakpoint","errorCode":null,"errorMessage":"data_id is required for set_data_breakpoint","messagePattern":"data_id is required for set_data_breakpoint","errorType":"validation","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/debug.ts","lineNumber":893,"sourceCode":"\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,\n\t\t\t\t\tparams.variable_ref ?? params.scope_id,\n\t\t\t\t\tparams.frame_id,\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.dataBreakpointInfo = response.info;\n\t\t\t\treturn result.text(formatDataBreakpointInfo(response.info)).done();\n\t\t\t}\n\t\t\tcase \"set_data_breakpoint\": {\n\t\t\t\trequireCapability(\"supportsDataBreakpoints\", \"data breakpoints\");\n\t\t\t\tif (!params.data_id) {\n\t\t\t\t\tthrow new ToolError(\"data_id is required for set_data_breakpoint\");\n\t\t\t\t}\n\t\t\t\tconst response = await dapSessionManager.setDataBreakpoint(\n\t\t\t\t\tparams.data_id,\n\t\t\t\t\tparams.access_type,\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.dataBreakpoints = response.breakpoints;\n\t\t\t\treturn result.text(formatDataBreakpoints(response.breakpoints)).done();\n\t\t\t}\n\t\t\tcase \"remove_data_breakpoint\": {\n\t\t\t\trequireCapability(\"supportsDataBreakpoints\", \"data breakpoints\");\n\t\t\t\tif (!params.data_id) {\n\t\t\t\t\tthrow new ToolError(\"data_id is required for remove_data_breakpoint\");\n\t\t\t\t}","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/debug.ts#L875-L911","documentation":"The set_data_breakpoint action throws this ToolError when params.data_id is missing. A data breakpoint watches a specific data_id returned by a prior data_breakpoint_info call; without it the adapter cannot identify what to watch. Capability supportsDataBreakpoints is required.","triggerScenarios":"Calling action=set_data_breakpoint with params.data_id undefined/empty — typically when the caller skips data_breakpoint_info and passes the variable name directly.","commonSituations":"Caller passes a variable name instead of the data_id from the info response; the info step was done in a previous session and the id is stale; params built from the wrong response object.","solutions":["Call data_breakpoint_info with the variable name first and copy its returned data_id","Pass that data_id to set_data_breakpoint along with access_type (read/write/readWrite) if desired","If the info call returned no data IDs, the adapter cannot watch that expression — do not attempt set_data_breakpoint"],"exampleFix":"// before\nawait debugTool.run({ action: 'set_data_breakpoint', name: 'myVar', access_type: 'write' });\n// after\nconst info = await debugTool.run({ action: 'data_breakpoint_info', name: 'myVar' });\nawait debugTool.run({ action: 'set_data_breakpoint', data_id: info.info.dataId, access_type: 'write' });","handlingStrategy":"validation","validationCode":"if (typeof params.data_id !== 'string' || params.data_id.length === 0) {\n  throw new Error('set_data_breakpoint needs data_id from data_breakpoint_info');\n}","typeGuard":"function hasDataId(p) {\n  return typeof p === 'object' && p !== null\n    && typeof (p as { data_id?: unknown }).data_id === 'string'\n    && (p as { data_id: string }).data_id.length > 0;\n}","tryCatchPattern":"try {\n  await debugTool.run({ action: 'set_data_breakpoint', ...params });\n} catch (err) {\n  if (err instanceof ToolError && err.message.includes('data_id is required')) {\n    // run data_breakpoint_info for the variable, extract dataId, then retry\n  } else throw err;\n}","preventionTips":["Treat data_breakpoint_info as a mandatory prerequisite to set_data_breakpoint","Never pass the raw variable name as data_id","Refresh data_ids after session restarts; they may be stale"],"tags":["debug","dap","parameter-validation","data-breakpoint"],"backgroundTag":"missing-required-parameter","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}