{"record":{"id":"90de828aa97c8c31","repo":"openclaw/openclaw","slug":"computer-invalid-request-label-coordinates-are","errorCode":null,"errorMessage":"COMPUTER_INVALID_REQUEST: ${label} coordinates are required","messagePattern":"COMPUTER_INVALID_REQUEST: (.+?) coordinates are required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/cua-computer/src/actions.ts","lineNumber":160,"sourceCode":"  }\n  const modifiers = segments.map((entry) => {\n    const normalized = MODIFIER_ALIASES.get(entry.toLowerCase());\n    if (!normalized) {\n      throw unsupportedKey(`unknown modifier ${JSON.stringify(entry)}`);\n    }\n    return normalized;\n  });\n  return { key: normalizeKey(rawKey), modifiers };\n}\n\nexport function scalePoint(\n  frame: CuaLastFrame,\n  x: number | undefined,\n  y: number | undefined,\n  label: string,\n): { x: number; y: number } {\n  if (x === undefined || y === undefined) {\n    throw new Error(`COMPUTER_INVALID_REQUEST: ${label} coordinates are required`);\n  }\n  if (x >= frame.deliveredWidth || y >= frame.deliveredHeight) {\n    throw new Error(\n      `COMPUTER_INVALID_REQUEST: ${label} coordinates are outside the captured primary-display frame`,\n    );\n  }\n  return {\n    x: Math.min(frame.nativeWidth - 1, Math.round((x * frame.nativeWidth) / frame.deliveredWidth)),\n    y: Math.min(\n      frame.nativeHeight - 1,\n      Math.round((y * frame.nativeHeight) / frame.deliveredHeight),\n    ),\n  };\n}\n","sourceCodeStart":142,"sourceCodeEnd":175,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/cua-computer/src/actions.ts#L142-L175","documentation":"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.","triggerScenarios":"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.","commonSituations":"Model emitted a click/move action missing a coordinate; command schema optional fields let undefined through; partial JSON params parsed into undefined.","solutions":["Ensure the action payload always includes both x and y before invoking the command.","Validate coordinates at the command boundary (zod schema requiring x,y as required numbers).","If a coordinate is genuinely absent, reject the request earlier with a clear message rather than calling scalePoint."],"exampleFix":"// before\nscalePoint(frame, x, undefined, 'start');\n// after\nif (x === undefined || y === undefined) throw new Error('x and y are required');\nscalePoint(frame, x, y, 'start');","handlingStrategy":"validation","validationCode":"function assertCoords(x, y) {\n  if (x === undefined || y === undefined) {\n    throw new Error('x and y coordinates are required');\n  }\n}","typeGuard":"function hasBothCoords(x, y) {\n  return x !== undefined && y !== undefined;\n}","tryCatchPattern":null,"preventionTips":["Make x and y required in the command's zod schema.","Reject coordinate-less actions at the command boundary.","Validate model output before forwarding to scalePoint."],"tags":["cua-computer","validation","coordinates","computer-use"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}