{"record":{"id":"333f0f52bf59d952","repo":"stablyai/orca","slug":"paste-text-requires-wl-copy-xclip-or-xsel","errorCode":null,"errorMessage":"paste_text requires wl-copy, xclip, or xsel","messagePattern":"paste_text requires wl-copy, xclip, or xsel","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"native/computer-use-linux/runtime.py","lineNumber":1012,"sourceCode":"        return\n    for command in ([\"xclip\", \"-selection\", \"clipboard\"], [\"xsel\", \"--clipboard\", \"--input\"]):\n        if not shutil.which(command[0]):\n            continue\n        process = subprocess.Popen(\n            command,\n            stdin=subprocess.PIPE,\n            stdout=subprocess.DEVNULL,\n            stderr=subprocess.DEVNULL,\n            text=True,\n        )\n        if process.stdin is not None:\n            process.stdin.write(value)\n            process.stdin.close()\n        time.sleep(CLIPBOARD_OWNER_SETTLE_SECONDS)\n        if process.poll() not in (None, 0):\n            raise RuntimeError(f\"{command[0]} failed to set clipboard\")\n        return\n    raise RuntimeError(\"paste_text requires wl-copy, xclip, or xsel\")\n\n\ndef set_value(node, value):\n    if node is not None and bool(attempt(node.is_editable_text, False)):\n        editable = attempt(node.get_editable_text_iface)\n        if editable is not None and attempt(lambda: Atspi.EditableText.set_text_contents(editable, str(value)), False):\n            return True\n    value_iface = attempt(node.get_value_iface) if node is not None else None\n    if value_iface is not None:\n        return bool(attempt(lambda: Atspi.Value.set_current_value(value_iface, float(value)), False))\n    return False\n\n\ndef run_operation(operation):\n    tool = operation.get(\"tool\")\n    include_screenshot = not bool(operation.get(\"noScreenshot\"))\n    if tool == \"handshake\":\n        return {\"ok\": True, \"capabilities\": handshake_response()}","sourceCodeStart":994,"sourceCodeEnd":1030,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/native/computer-use-linux/runtime.py#L994-L1030","documentation":"Raised by write_clipboard (runtime.py:1012) when none of wl-copy, xclip, or xsel is found on PATH. This is a hard dependency check — the runtime has no in-process clipboard implementation and shells out to one of these three tools. Reached only after the wl-copy branch and the xclip/xsel loop both miss.","triggerScenarios":"paste_text or any write_clipboard caller runs on a host missing all three clipboard utilities. The error propagates out of paste_text, which is itself wrapped so the finally block still attempts to restore the (unreadable) prior clipboard.","commonSituations":"Minimal server/container images; a fresh WSL/headless install; CI environments; systems where the user uninstalled X11 tools.","solutions":["Install one of: wl-clipboard (wl-copy), xclip, or xsel (apt install wl-clipboard / xclip / xsel).","Prefer wl-clipboard on Wayland sessions and xclip/xsel on X11.","If paste isn't needed, use type_text instead to avoid the clipboard dependency entirely."],"exampleFix":"# before: no clipboard tool installed\n# after (shell):\nsudo apt install xclip  # or: wl-clipboard","handlingStrategy":"type-guard","validationCode":"import shutil\n\ndef has_clipboard_tool():\n    return any(shutil.which(t) for t in (\"wl-copy\", \"xclip\", \"xsel\"))\n\nif not has_clipboard_tool():\n    raise EnvironmentError(\"install wl-clipboard, xclip, or xsel for paste support\")","typeGuard":"import shutil\n\ndef supports_paste() -> bool:\n    return any(shutil.which(t) for t in (\"wl-copy\", \"xclip\", \"xsel\"))","tryCatchPattern":"try:\n    run_operation(op)\nexcept RuntimeError as e:\n    if \"requires wl-copy, xclip, or xsel\" in str(e):\n        op = {\"tool\": \"type_text\", \"text\": text}  # degrade to typing\n        run_operation(op)\n    else:\n        raise","preventionTips":["Install wl-clipboard, xclip, or xsel in the runtime image.","Prefer type_text over paste_text when clipboard tools may be absent.","Probe for a clipboard tool at startup and disable paste UI when missing."],"tags":["environment","computer-use","clipboard","python"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}