can1357/oh-my-pi · error · ToolError

name is required for data_breakpoint_info

Error message

name is required for data_breakpoint_info

What it means

The data_breakpoint_info action throws this ToolError when params.name is missing. Data breakpoint info queries which data IDs (and access modes) are available for a named expression/variable, so the variable name is mandatory. Capability supportsDataBreakpoints is checked first.

Source

Thrown at packages/coding-agent/src/tools/debug.ts:877

			case "remove_instruction_breakpoint": {
				requireCapability("supportsInstructionBreakpoints", "instruction breakpoints");
				if (!params.instruction_reference) {
					throw new ToolError("instruction_reference is required for remove_instruction_breakpoint");
				}
				const response = await dapSessionManager.removeInstructionBreakpoint(
					params.instruction_reference,
					params.offset,
					combinedSignal,
					timeoutSec * 1000,
				);
				details.snapshot = response.snapshot;
				details.instructionBreakpoints = response.breakpoints;
				return result.text(formatInstructionBreakpoints(response.breakpoints)).done();
			}
			case "data_breakpoint_info": {
				requireCapability("supportsDataBreakpoints", "data breakpoints");
				if (!params.name) {
					throw new ToolError("name is required for data_breakpoint_info");
				}
				const response = await dapSessionManager.dataBreakpointInfo(
					params.name,
					params.variable_ref ?? params.scope_id,
					params.frame_id,
					combinedSignal,
					timeoutSec * 1000,
				);
				details.snapshot = response.snapshot;
				details.dataBreakpointInfo = response.info;
				return result.text(formatDataBreakpointInfo(response.info)).done();
			}
			case "set_data_breakpoint": {
				requireCapability("supportsDataBreakpoints", "data breakpoints");
				if (!params.data_id) {
					throw new ToolError("data_id is required for set_data_breakpoint");
				}
				const response = await dapSessionManager.setDataBreakpoint(

View on GitHub (pinned to 9690622007)

Solutions

  1. Pass the variable/expression name, e.g. {name: 'myVar', frame_id: currentFrameId}
  2. Optionally add variable_ref or scope_id to disambiguate the scope of the name
  3. Confirm the debug adapter supports data breakpoints before calling

Example fix

// before
await debugTool.run({ action: 'data_breakpoint_info', frame_id: 1 });
// after
await debugTool.run({ action: 'data_breakpoint_info', name: 'myVar', frame_id: 1 });
Defensive patterns

Strategy: validation

Validate before calling

if (typeof params.name !== 'string' || params.name.trim().length === 0) {
  throw new Error('data_breakpoint_info needs a variable name');
}

Type guard

function hasName(p) {
  return typeof p === 'object' && p !== null
    && typeof (p as { name?: unknown }).name === 'string'
    && (p as { name: string }).name.trim().length > 0;
}

Try / catch

try {
  await debugTool.run({ action: 'data_breakpoint_info', ...params });
} catch (err) {
  if (err instanceof ToolError && err.message.includes('name is required')) {
    // resolve the variable name from the current frame/scopes, then retry
  } else throw err;
}

Prevention

When it happens

Trigger: Calling action=data_breakpoint_info with params.name empty, undefined, or omitted; optional variable_ref/scope_id/frame_id may be present but name is still required.

Common situations: Caller only supplies a frame_id expecting info for the whole frame; name key typo'd (e.g. variableName); agent copies a watch-expression object instead of the name string.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/20729059e059ee55. Report an issue: GitHub.