{"record":{"id":"bf7c5ef88e1d1c9a","repo":"Hmbown/CodeWhale","slug":"value-verification-failed","errorCode":null,"errorMessage":"value_verification_failed","messagePattern":"value_verification_failed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/backends/linux.mjs","lineNumber":709,"sourceCode":"    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    },\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)]","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/backends/linux.mjs#L691-L727","documentation":"set_value verifies its own write: after setTextContents succeeds, it reads the text back via queryText and compares it to the requested value. Any mismatch raises RuntimeError(\"value_verification_failed\"), because an unverifiable write is treated as a failed edit rather than a silently ambiguous one.","triggerScenarios":"The readback text (text.getText(0, characterCount)) differs from extra — the widget normalized the value (trimmed whitespace, reformatted dates/numbers), truncated it, or an async edit had not settled before readback.","commonSituations":"Setting values into fields the app reformats (currency, dates, phone numbers); writing to fields with auto-trim or auto-complete that mutates input; very large values that the widget truncates.","solutions":["Set a value that survives the field's normalization exactly (match its formatting)","Read the field's current format first and conform to it","Compare loosely in your own retry wrapper and accept normalized-equivalent results","Use keyboard input plus your own verification if the field auto-transforms text"],"exampleFix":"// before\nawait backend.set_value({ target: \"#amount\", value: \"1234.500\" }) // field normalizes to 1234.5\n// after\nawait backend.set_value({ target: \"#amount\", value: \"1234.5\" });","handlingStrategy":"try-catch","validationCode":"// check the field's current formatting and conform your value to it\nconst current = await backend.get_value?.(target);\nif (current && normalizes(value) !== normalizes(current)) console.warn(\"field may reformat this value\");","typeGuard":null,"tryCatchPattern":"try { return await backend.set_value({ target, value }); } catch (e) { if (String(e).includes(\"value_verification_failed\")) { const actual = await backend.get_value?.(target); if (normalizedEquals(actual, value)) return { accepted: true }; } throw e; }","preventionTips":["Match the field's exact output format (dates, currency, trimming)","Avoid values the application transforms on input","Compare post-hoc with normalization when fields legitimately reformat"],"tags":["accessibility","atspi","linux","ui-automation"],"backgroundTag":"value-verification-failed","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"}