{"record":{"id":"69e82f0919ba7db0","repo":"Hmbown/CodeWhale","slug":"invalid-value","errorCode":null,"errorMessage":"invalid_value","messagePattern":"invalid_value","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/backends/linux.mjs","lineNumber":714,"sourceCode":"        raise RuntimeError(\"element_disabled\")\n    try:\n        editor = found.queryEditableText()\n    except NotImplementedError:\n        editor = None\n    if editor is not None:\n        if not state.contains(pyatspi.STATE_EDITABLE):\n            raise RuntimeError(\"element_read_only\")\n        if not editor.setTextContents(extra):\n            raise RuntimeError(\"value_rejected\")\n        text = found.queryText()\n        after = text.getText(0, text.characterCount)\n        if after != extra:\n            raise RuntimeError(\"value_verification_failed\")\n    else:\n        import math\n        desired = float(extra)\n        if not math.isfinite(desired):\n            raise RuntimeError(\"invalid_value\")\n        numeric = found.queryValue()\n        numeric.currentValue = desired\n        after = numeric.currentValue\n        if after != desired:\n            raise RuntimeError(\"value_verification_failed\")\n    print(json.dumps({\"ok\": True, \"after\": after}))`, String(value));\n      if (!out.ok) throw new ExecError(`set_value failed: ${out.code}`);\n      return { action_sent: true, strategy: \"a11y\", verified: true, after: out.after };\n    },\n    select_text: async () => { throw new ExecError(\"select_text is not implemented on the linux backend — fail-closed\"); },\n    perform_action: async ({ target, action }) => {\n      const body = `    a = found.queryAction()\n    names = [a.getName(i) for i in range(a.nActions)]\n    want = (extra or \"click\").lower()\n    match = next((n for n in names if n.lower() == want), None)\n    if match is None and want == \"click\":\n        match = next((n for n in names if n.lower() in (\"click\", \"press\", \"activate\")), None)\n    if match is None:","sourceCodeStart":696,"sourceCodeEnd":732,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/backends/linux.mjs#L696-L732","documentation":"When the target has no EditableText interface, set_value falls back to the AT-SPI Value interface: it parses the requested value as a float and rejects non-finite values with RuntimeError(\"invalid_value\") before assigning numeric.currentValue. This keeps NaN/Infinity from being pushed into a numeric control.","triggerScenarios":"Calling set_value on a numeric control (slider, spinbox, progress) with value=\"NaN\", value=\"Infinity\", value=\"-Infinity\", or any string that float() cannot parse — float() raises ValueError first for non-numeric strings.","commonSituations":"Automating sliders/spinboxes with symbolic values instead of numbers; passing a locale-formatted number (\"1,234.5\") that float() rejects; generated code substituting 'NaN' for missing data.","solutions":["Pass a finite numeric string or number, e.g. \"42\" or \"3.14\"","Pre-parse and validate with Number.isFinite in the caller before set_value","Use the appropriate numeric control's range (check min/max) to avoid a subsequent rejection"],"exampleFix":"// before\nawait backend.set_value({ target: \"#volume\", value: \"NaN\" }) // invalid_value\n// after\nawait backend.set_value({ target: \"#volume\", value: \"75\" });","handlingStrategy":"validation","validationCode":"const n = Number(value);\nif (!Number.isFinite(n)) throw new Error(`set_value on a numeric control requires a finite number, got ${value}`);","typeGuard":"const isFiniteNumeric = (v) => { const n = Number(v); return v !== \"\" && v != null && Number.isFinite(n); };","tryCatchPattern":"try { return await backend.set_value({ target, value }); } catch (e) { if (String(e).includes(\"invalid_value\")) { throw new Error(`not a finite numeric value: ${JSON.stringify(value)}`); } throw e; }","preventionTips":["Coerce and validate numeric inputs at the boundary before automation","Never substitute 'NaN'/'Infinity' for missing data in automation scripts","Detect value-vs-text controls and route values to the right one"],"tags":["accessibility","atspi","linux","ui-automation","numeric"],"backgroundTag":"invalid-argument-value","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T16:17:23.217Z"}