{"record":{"id":"71218500afe51ec4","repo":"Hmbown/CodeWhale","slug":"select-text-is-not-implemented-on-the-linux-backend-fail","errorCode":null,"errorMessage":"select_text is not implemented on the linux backend — fail-closed","messagePattern":"select_text is not implemented on the linux backend — fail-closed","errorType":"exception","errorClass":"ExecError","httpStatus":null,"severity":"warning","filePath":"crates/tui/plugins/computer-use/src/backends/linux.mjs","lineNumber":724,"sourceCode":"        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:\n        print(json.dumps({\"ok\": False, \"code\": \"action_not_found: \" + \",\".join(names)}))\n    else:\n        a.doAction(names.index(match))\n        print(json.dumps({\"ok\": True, \"sent\": True}))`;\n      const out = await atspiResolve(target, body, String(action));\n      if (!out.ok) throw new ExecError(`perform_action failed: ${out.code}`);\n      return { action_sent: true, strategy: \"a11y\", action };\n    },\n    read_clipboard: async () => {\n      await probeSession();","sourceCodeStart":706,"sourceCodeEnd":742,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/backends/linux.mjs#L706-L742","documentation":"The linux computer-use backend does not implement select_text; the create path raises this sentinel to fail closed rather than silently performing no selection. Any automation invoking select_text on Linux hits this guard — the unsupported operation itself is the input at fault.","triggerScenarios":"Any call to backend.select_text(...) regardless of arguments, on the linux backend.","commonSituations":"Cross-platform scripts written against a macOS/Windows backend that supports select_text, run unmodified against Linux; feature-detection code missing a capability check before invoking selection.","solutions":["Do not call select_text on Linux; check backend capabilities before invoking.","Use perform_action with an appropriate a11y action on the text element, or select via keyboard (key sequences like shift+arrows through the key API).","Gate the call: if (platform !== 'darwin') skip selection step.","If selection is essential, route that step through an X11 clipboard-based workaround (copy via key, then read_clipboard)."],"exampleFix":"// before\nawait backend.select_text({ target, range: [0, 10] }); // always throws on linux\n// after\nif (backend.capabilities?.includes('select_text')) {\n  await backend.select_text({ target, range: [0, 10] });\n} else {\n  await backend.key({ text: 'Home' });\n  await backend.key({ text: 'shift+End' }); // keyboard selection fallback\n}","handlingStrategy":"fallback","validationCode":"if (!backendCapabilities.includes('select_text')) useKeyboardSelection();","typeGuard":null,"tryCatchPattern":"try {\n  await backend.select_text(args);\n} catch (e) {\n  if (String(e.message).includes('not implemented on the linux backend')) {\n    return keyboardSelectFallback(args); // key: shift+arrows etc.\n  }\n  throw e;\n}","preventionTips":["Feature-detect capabilities per backend before invoking platform-specific methods","Write cross-platform scripts against a lowest-common-denominator action set","Use keyboard-based selection on Linux instead of a11y select_text"],"tags":["linux","not-implemented","fail-closed","feature-parity","accessibility"],"backgroundTag":"method-not-implemented","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"}