openclaw/openclaw · error · Error

COMPUTER_INVALID_REQUEST: ${label} coordinates are required

Error message

COMPUTER_INVALID_REQUEST: ${label} coordinates are required

What it means

Thrown by scalePoint when either x or y is undefined. Both coordinates are mandatory to map a point from the delivered frame into native display coordinates; calling scalePoint without them is a programming error.

Source

Thrown at extensions/cua-computer/src/actions.ts:160

  }
  const modifiers = segments.map((entry) => {
    const normalized = MODIFIER_ALIASES.get(entry.toLowerCase());
    if (!normalized) {
      throw unsupportedKey(`unknown modifier ${JSON.stringify(entry)}`);
    }
    return normalized;
  });
  return { key: normalizeKey(rawKey), modifiers };
}

export function scalePoint(
  frame: CuaLastFrame,
  x: number | undefined,
  y: number | undefined,
  label: string,
): { x: number; y: number } {
  if (x === undefined || y === undefined) {
    throw new Error(`COMPUTER_INVALID_REQUEST: ${label} coordinates are required`);
  }
  if (x >= frame.deliveredWidth || y >= frame.deliveredHeight) {
    throw new Error(
      `COMPUTER_INVALID_REQUEST: ${label} coordinates are outside the captured primary-display frame`,
    );
  }
  return {
    x: Math.min(frame.nativeWidth - 1, Math.round((x * frame.nativeWidth) / frame.deliveredWidth)),
    y: Math.min(
      frame.nativeHeight - 1,
      Math.round((y * frame.nativeHeight) / frame.deliveredHeight),
    ),
  };
}

View on GitHub (pinned to 01804a7531)

Solutions

  1. Ensure the action payload always includes both x and y before invoking the command.
  2. Validate coordinates at the command boundary (zod schema requiring x,y as required numbers).
  3. If a coordinate is genuinely absent, reject the request earlier with a clear message rather than calling scalePoint.

Example fix

// before
scalePoint(frame, x, undefined, 'start');
// after
if (x === undefined || y === undefined) throw new Error('x and y are required');
scalePoint(frame, x, y, 'start');
Defensive patterns

Strategy: validation

Validate before calling

function assertCoords(x, y) {
  if (x === undefined || y === undefined) {
    throw new Error('x and y coordinates are required');
  }
}

Type guard

function hasBothCoords(x, y) {
  return x !== undefined && y !== undefined;
}

Prevention

When it happens

Trigger: A computer.act call supplies only one of x/y, omits both, or passes a payload where the model/tool did not include the coordinate. The action handler calls scalePoint(frame, x, y, label) before any scaling math.

Common situations: Model emitted a click/move action missing a coordinate; command schema optional fields let undefined through; partial JSON params parsed into undefined.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/90de828aa97c8c31. Report an issue: GitHub.