{"record":{"id":"755b677afb3fbbf8","repo":"Hmbown/CodeWhale","slug":"pointer-action-must-be-move-down-or-up-got-json-stringify","errorCode":null,"errorMessage":"pointer action must be \"move\", \"down\" or \"up\" (got ${JSON.stringify(args.action)})","messagePattern":"pointer action must be \"move\", \"down\" or \"up\" \\(got (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/tools.mjs","lineNumber":778,"sourceCode":"      const clicks = args.clicks ?? 1;\n      const rest = { ...args };\n      delete rest.button;\n      delete rest.clicks;\n      const wire = button === \"left\" && clicks === 1 ? \"left_click\"\n        : button === \"left\" && clicks === 2 ? \"double_click\"\n        : button === \"left\" && clicks === 3 ? \"triple_click\"\n        : button === \"right\" && clicks === 1 ? \"right_click\"\n        : button === \"middle\" && clicks === 1 ? \"middle_click\"\n        : null;\n      if (!wire) throw bad(`click supports left with 1-3 clicks, right x1 or middle x1 (got ${JSON.stringify(button)} x${clicks})`);\n      if (button !== \"left\") delete rest.strategy; // strategy is an a11y-left-click concept\n      return { name: wire, args: rest };\n    }\n    case \"pointer\": {\n      const rest = { ...args };\n      delete rest.action;\n      const wire = { move: \"mouse_move\", down: \"left_mouse_down\", up: \"left_mouse_up\" }[args.action];\n      if (!wire) throw bad(`pointer action must be \"move\", \"down\" or \"up\" (got ${JSON.stringify(args.action)})`);\n      return { name: wire, args: rest };\n    }\n    case \"clipboard\": {\n      const rest = { ...args };\n      delete rest.action;\n      if (args.action === \"read\") return { name: \"read_clipboard\", args: { computer: rest.computer } };\n      if (args.action === \"write\") {\n        if (typeof rest.text !== \"string\") throw bad(\"clipboard action \\\"write\\\" requires text\");\n        return { name: \"write_clipboard\", args: { text: rest.text, computer: rest.computer } };\n      }\n      throw bad(`clipboard action must be \"read\" or \"write\" (got ${JSON.stringify(args.action)})`);\n    }\n    case \"recording\": {\n      const rest = { ...args };\n      delete rest.action;\n      const wire = { start: \"recording_start\", stop: \"recording_stop\", status: \"recording_status\", list: \"recording_list\" }[args.action];\n      if (!wire) throw bad(`recording action must be start, stop, status or list (got ${JSON.stringify(args.action)})`);\n      if ((args.action === \"stop\" || args.action === \"status\") && rest.id == null) throw bad(`recording action \"${args.action}\" requires id`);","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/tools.mjs#L760-L796","documentation":"The `pointer` tool maps its `action` argument to a wire tool: move, down, or up. When args.action is anything else (or undefined), the lookup returns undefined and this error is thrown because the resolver cannot translate the request.","triggerScenarios":"Calling resolveTool for \"pointer\" with action:\"press\", action:\"drag\", a missing action field, or a wrong-typed action like the number 1.","commonSituations":"A model writes \"click\" instead of \"move\"/\"down\"/\"up\" (clicking is the separate click tool); the action field is omitted entirely; case mismatch like \"Move\".","solutions":["Set action to exactly \"move\", \"down\", or \"up\"","Use the dedicated click tool instead of pointer for click semantics","Check that the action key is spelled and cased correctly and actually present in args"],"exampleFix":"// before\nresolveTool(\"pointer\", { action: \"click\" })\n// after\nresolveTool(\"pointer\", { action: \"move\" }) // or \"down\" / \"up\"; use \"click\" tool for clicks","handlingStrategy":"validation","validationCode":"if (!['move','down','up'].includes(args.action)) throw new Error('pointer action must be move/down/up');","typeGuard":"function isPointerAction(a) { return a === 'move' || a === 'down' || a === 'up'; }","tryCatchPattern":null,"preventionTips":["Use the click tool for click semantics, pointer only for move/down/up","Normalize action strings to lowercase before dispatch","Remember pointer \"press\" = down then up as two calls"],"tags":["validation","arguments","computer-use"],"backgroundTag":"invalid-enum-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T21:17:16.096Z"}