{"record":{"id":"f09a283abe8e8a2e","repo":"Hmbown/CodeWhale","slug":"value-rejected","errorCode":null,"errorMessage":"value_rejected","messagePattern":"value_rejected","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/backends/linux.mjs","lineNumber":705,"sourceCode":"        } finally { await releaseKey(k); }\n      } else await waylandKey(text, { holdMs: Math.round(d * 1000) });\n      return { action_sent: true, key: k, heldSec: d };\n    },\n    set_value: async ({ target, value }) => {\n      // Select a supported interface before sending input. A refused write or\n      // failed readback must never trigger a second, ambiguously applied edit.\n      const out = await atspiResolve(target, `    state = found.getState()\n    if not state.contains(pyatspi.STATE_ENABLED):\n        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    },","sourceCodeStart":687,"sourceCodeEnd":723,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/backends/linux.mjs#L687-L723","documentation":"After confirming the target is enabled and editable, set_value calls editor.setTextContents(extra) via AT-SPI. A false return means the accessibility layer refused the write; the script raises RuntimeError(\"value_rejected\") rather than proceeding without knowing whether the value landed.","triggerScenarios":"setTextContents returning false — the toolkit accepted the call but rejected the content or the operation at the widget level, e.g. an input mask, length limit, or IME/permission constraint on the control.","commonSituations":"Writing a value longer than the field's max length; writing text that a masked input (date/phone) rejects; the application's own validation hooking text insertion and refusing it.","solutions":["Check the value conforms to the field's constraints (length, mask, charset) and retry","Clear the field first, then set the value in a smaller chunk","Use keyboard input strategies instead of direct text-set for masked fields","Re-resolve the target in case the widget was recreated mid-call"],"exampleFix":"// before\nawait backend.set_value({ target: \"#date\", value: \"not-a-date\" }) // value_rejected\n// after\nawait backend.set_value({ target: \"#date\", value: \"2026-09-21\" });","handlingStrategy":"retry","validationCode":"// pre-check content constraints when known\nif (maxLength && value.length > maxLength) throw new Error(`value exceeds field max length ${maxLength}`);","typeGuard":null,"tryCatchPattern":"try { return await backend.set_value({ target, value }); } catch (e) { if (String(e).includes(\"value_rejected\")) { await clearField(target); return backend.set_value({ target, value }); } throw e; }","preventionTips":["Conform values to field masks and length limits before writing","Clear the field before setting when it may already hold content","Fall back to keyboard input for fields with app-level insertion hooks"],"tags":["accessibility","atspi","linux","ui-automation"],"backgroundTag":"value-rejected","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"}