Files
Aleksander DygońandClaude Opus 5.5 2c48e5d5f3 Ship Computer Use driver 0.69.1 so Windows shortcuts reach WhatsApp (#20856)
* Ship Computer Use driver 0.69.1 so Windows shortcuts reach WhatsApp

On Windows, cua-driver 0.52.9 sends every hotkey for a XAML-host window,
such as WhatsApp, through a UI Automation accelerator scan, also with
delivery_mode foreground (platform-windows tools/hotkey.rs:266). When the
app's UIA provider does not answer, the scan stops after 4000 ms with a
plain error, not background_unavailable. So the agent rule that retries
an action in the foreground does not start, and a foreground retry takes
the same scan. No shortcut reaches the app in any mode.

Upstream fixed this in trycua/cua#8909 (3a8f860): a foreground hotkey to
a XAML host goes through SendInput, and a failed background scan answers
background_unavailable. The first release with the fix is 0.69.1. Pin
it, with digests from `bun run pin:cua-driver 0.69.1`.

The new driver lists one new tool, set_agent_cursor_badge. It belongs to
the driver cursor tools that the tap already hides, so add it to that set
and agents see the same tools as before.

Checked with the linux-x64 0.69.1 binary: `serve --socket --no-overlay`
and `mcp --socket` are accepted; the daemon socket answers list_windows,
sessions_list and session_end as the highlight reads them; MCP initialize
reports 0.69.1; the tool list differs from 0.52.9 only by
set_agent_cursor_badge, with no removed tool or argument; run_steps keeps
its step keys and get_window_state keeps screenshot_out_file.
test:cua-driver-foreground-input fails on this host with 0.52.9 and
0.69.1 alike (the probe window is not listed), so it gives no result.

The empty WhatsApp accessibility tree (BuildUpdatedCache E_FAIL) is not
fixed upstream and stays.

Fixes #19016

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Say that driver 0.69.1 still has the documented Computer Use problems

The architecture notes named only driver 0.52.9 for the problems that the
tap and the agent instructions work around. Each problem is still in
0.69.1: trycua/cua#8117 is an open PR, and #6755, #7930 and #4920 are
open issues. In 0.69.1, `opt_str` still returns an empty
`screenshot_out_file` as a path (cua-driver-core tool_args.rs:511,
platform-windows get_window_state.rs:473). So each workaround stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 18:43:35 +01:00

33 KiB
Raw Permalink Blame History

Computer Use and remote desktop

Computer Use

Computer Use is cua-driver, a third-party MIT binary, and OpenBot owns how it runs. cua-driver-runtime.ts in the main process starts one long-lived serve daemon and holds it; each provider CLI spawns its own short-lived cua-driver mcp --socket proxy against that daemon. All screen capture, accessibility reads, and input posting happen inside the daemon, so the proxy's own identity does not matter.

The daemon is spawned directly, and never through open(1) or NSWorkspace. macOS finds the responsible process by walking up the launch chain, so a direct spawn puts OpenBot at the top of it and the user grants Screen Recording and Accessibility to OpenBot rather than to somebody else's helper. CUA_DRIVER_EMBEDDED=1 tells the driver to stay on that path instead of relaunching itself as its own application. Anything that launches the daemon another way breaks the attribution, which is the reason the earlier Codex helper was replaced.

Startup calls warmUp(), which reads the state once and keeps the daemon only when both grants are there. A user who granted them keeps the tools after a restart, and a remote request or a scheduled task — neither of which opens a window — reaches them too. A user who granted nothing keeps no process, and no prompt is raised either way: only using the driver asks for a grant. Every other start is lazy, on a state read from the panel.

The control socket lives in the private per-user runtime directory, mode 0o700, not in /tmp: whoever reaches it can drive the whole desktop. It cannot live under userData, because sockaddr_un.sun_path holds 104 bytes on macOS and an isolated development profile spends most of them on the worktree hash. Windows uses a named pipe, which has no such limit; its name is random, because Windows lets a second process add an instance to a name it can guess, and it is kept in the profile so that it is random once rather than once per launch. The endpoint has to hold still: it reaches each proxy as an argument, and the arguments are folded into the stored Codex tool fingerprint, so a name that moves at each launch replaces every session after a restart. The command has to hold still for the same reason: the packaged Linux build is an AppImage, whose resources are mounted somewhere else at each launch, so there the proxies are given a link below the profile that the runtime points at this run's driver.

One MCP entry reaches every provider. CuaDriverRuntime.mcpServerConfig() returns a config only while the daemon runs, and AgentService.enabledMcpServers() appends it, which is the one function Codex, Claude, and ACP all read. Two properties keep it there: the name is not in RESERVED_MCP_SERVER_NAMES, which is a drop filter rather than a marker, and workingDirectory stays empty, because ACP has no field for one, so an entry with one would vanish for ACP providers with no error. Codex staleness needs no separate signal, because toolFingerprint already folds the MCP entries and a changed fingerprint forces a replacement session. onMcpServerChanged is what refreshes the agent runtimes, which deactivates every stored provider session: the next turn starts a new one, which keeps the public thread and loses what the provider held privately. So it reports two moments only — the entry appearing on a start a user asked for, and the daemon dying under OpenBot. It is quiet for a grant given while the daemon serves, which changes the state and not the tool set; for the startup warm-up, which settles the entry the stored sessions already had; and for the stop at teardown, which happens at order 55, before the agent service at 110, and would otherwise deactivate on every quit the sessions the next run is meant to resume.

capabilities.computerUse is pushed by main from the daemon's own permission answer. It is no longer probed from Codex plugin/list, which is why the capability now reports the same state for every provider.

The driver is packaged, not downloaded on demand, so it is pinned in native-runtime.lock.json like the other native runtimes rather than managed like a provider CLI. The pinned file list is an allowlist: scripts/install-cua-driver.ts copies only the named paths and checks each digest, so an upstream layout change fails the build instead of shipping a surprise file. Each installer carries only its own target. On macOS mac.signIgnore keeps the vendor's Developer ID signature, because re-signing under OpenBot's inherited entitlements would drop the Automation entitlement the driver needs. A packaged build reads the copy under resources/cua-driver and nothing else, because the release is pinned and signed against that build and an environment variable must not decide which program drives the user's desktop; a release without the binary reports no driver. In a checkout resolveCuaDriver also reads an override, an install directory and PATH, so a developer can point OPENBOT_CUA_DRIVER_PATH at another build.

OpenBot draws the agent cursor in its own per-display overlays for every display layout. The runtime starts serve with --no-overlay. The driver's overlay covers only the main display and cannot follow a display connected after startup. Keeping cursor ownership in OpenBot lets the highlight controller add, resize, and remove display overlays without restarting the daemon or changing provider sessions. The tap removes the driver's own cursor tools (set_agent_cursor_* and get_agent_cursor_state) from the tool list: with --no-overlay they change nothing on the screen, and on macOS they refuse. move_cursor stays, because OpenBot draws its cursor at the point of that call. A click or a scroll aimed at a window names a pixel of that window's last get_window_state screenshot, not a desktop point. The tap keeps the screenshot_width of each window from that answer and saves it with the point when the click passes. The cursor goes to the window's top-left corner plus the point times the window width divided by that screenshot width, as the driver computes it. A click that OpenBot cannot place (no window_id, a point in a zoom image, or no screenshot width yet) removes the cursor. A window that is not in list_windows gets no cursor. The driver tells agents to act through run_steps, which runs its steps inside the daemon, so the tap reads the steps of that call in order, each as its own call. A step without a window gets the window of the batch or of the last step that named one, as in the driver. A step that names its window only by app or window title removes the cursor, because only the driver resolves it. The driver skips the reads between the steps of a batch and does one read at the end. The tap keeps the screenshot_width of that end read (observation.state in the answer) as of a direct read.

The rim (chooseTarget in computer-use-target-window.ts) marks only a window that the agent named in the past 60 s: the window_id of its last call, or the top window under its last desktop point (a desktop-scope click or move_cursor), which is the window that the driver clicks. When that window is too small to mark, such as a menu, or the call named only a pid, the rim marks the only window of that app, or the window that it marked before when the app has more windows. A desktop point over no window, or over an OpenBot window, takes the rim down, as does a call that names its window only by app or window title, because only the driver resolves it. When the agent names nothing, as with the driver's browser_* tools, which name only a tab, the rim stays on the window that it marked before, while the driver session is live. When the agent has named no window yet, no rim shows. OpenBot never marks the front window as a guess: on a shared desktop that is often the user's own window, also on another display (#17288).

On macOS, drivers 0.52.9 and 0.69.1 keep no screenshot frame after a read that ends in ax_window_unresolved: the window exists, but no accessibility window claims it, as with Premiere Pro. Every pixel action on that window is then refused as window_never_read, also in the foreground, and a new full read does the same again (#14480, upstream trycua/cua#6755). A screenshot-only read (include_accessibility_tree: false, include_screenshot: true) has no accessibility result to fail, so the driver keeps its frame. The agent instructions name that read on macOS. When a driver release with trycua/cua#8117 is pinned, the rule can go.

Drivers 0.52.9 and 0.69.1 read an empty screenshot_out_file as a file path: get_window_state then takes a screenshot also with include_screenshot: false, fails to write the PNG to "", and fails the whole read, accessibility tree included (#18369). Some models send "" for each optional string. So the tap reads every request line on every platform and removes screenshot_out_file when it is exactly "", from a direct get_window_state call, from each get_window_state step of a run_steps call, and from its observe. A line without that empty field goes to the driver as it is. When a driver release reads an empty path as no path, the rewrite can go.

On a Linux desktop where the driver uses its X11 routes (an X11 session, or XWayland without CUA_DRIVER_RS_ENABLE_WAYLAND) and no separate agent display is set, the tap sends every input call in the foreground. Background input on X11 adds an XInput2 master pointer and keyboard that drivers 0.52.9 and 0.69.1 keep until the X server exits, and while it exists Chromium and Electron windows, OpenBot included, get no keys from the user's keyboard (#15359, upstream trycua/cua#7930). The tap reads which tools take delivery_mode from the tool list, sets delivery_mode: "foreground" on calls to those tools and on each run_steps step that names a mode, and leaves a request line that it cannot parse, or that is too long, unchanged. It also removes parallel_mouse_drag from the tool list, because that tool has no foreground route on X11. The agent instructions on that desktop say that the app comes to the front for each action. scripts/cua-driver-foreground-input-e2e.ts runs the real driver behind the tap on Xvfb and checks that typed text reaches an Electron window and that no extra master device appears. When a driver release fixes trycua/cua#7930, the rewrite can go.

iPhone Mirroring (com.apple.ScreenContinuity) drops the window routes of drivers 0.52.9 and 0.69.1 on macOS 26, and the driver answers unverifiable (#14837). A background click stamps the screen point, which the mirror does not map to the phone (upstream trycua/cua#4920; #5492 changes this only on macOS 27). A foreground window click is posted to the pid, and the mirror takes no pid-posted tap. Only the desktop scope reaches it: a click and a scroll at a get_desktop_state point go through the global HID queue, and a scroll first posts real MouseMoved events at the point. So the macOS agent instructions name the desktop scope for iPhone Mirroring, with bring_to_front before each click or scroll, because desktop input goes to the window in front. get_desktop_state captures only the main display, so the agent first moves a mirror on another display there. The mirror samples HID report state and misses a press shorter than one report, so the daemon gets CUA_DRIVER_CLICK_GAP_MS=60 on macOS, in place of the driver's 28 ms. oh-my-pi holds 60 ms and mirroir-mcp 50 ms for the same reason. A longer hold also suits an NSButton tracking loop, which the driver's own note says can miss a shorter one. When a driver release fixes the window routes, the rule can go.

Agent display on a server

A self-hosted server and the container start two Xvfb displays, and name the agent display in OPENBOT_AGENT_DISPLAY. The agent display has a white root (Xvfb -wr), because remote desktop shows a black root as if no video came. xsetroot gives it an arrow pointer, because the default "×" of an empty display looks like an error, and -noreset keeps the arrow.

scripts/hosting/openbot-desktop starts Openbox on the agent display, with the configuration and the flat light theme in scripts/hosting/desktop/. Before Openbox starts, hsetroot draws the background: the dark color of the app (#1a1a1a) with the OpenBot logo (desktop/openbot-logo.png, the lilac logo with a light name from @openbot/brand) in the center, at each display size. Without hsetroot, the white root stays, because a dark screen with no logo looks like no video.

Windows get title bars, and a click focuses and raises a window. A right-click on the empty screen or on a title bar opens a menu: Terminal (lxterminal), Files (pcmanfm) and the open windows. A maximized window thus does not hide the menu. Openbox takes only Alt+Tab, Alt+Shift+Tab and Alt+F4; all other keys and mouse actions go to the window, so Computer Use input arrives as before. The configuration has one desktop and no iconify action, so nothing moves the windows of an agent out of view. The script starts Openbox again when it stops, and exits when the display stops or when Openbox fails 5 times in a row. When the openbox package is missing, it does nothing, so a server with the old package list keeps the bare display.

Programs from the menu run as the service user, as the agents do, so the Terminal item gives a shell as that user. Remote control of a computer gives this control on a desktop host too, and only the roles that the owner permits in Server settings › Remote desktop can use input on the display. Openbox and the menu programs get the OOM value (500) and the nice value (10) of agent processes, so a build in that terminal does not take memory or CPU from main. The menu labels are in the Openbox configuration and are not translated.

A boat hosted server names its desktop :0, and OpenBot runs on an Xvfb display. Electron keeps its own DISPLAY: the built-in browser draws its tabs in the OpenBot window, and under Xvfb a hidden view gives no capture and no clicks, so OpenBot cannot only hide its window. On Linux, agent-display.ts sets DISPLAY to the agent display for the driver daemon, for Sunshine, and in agentEnvironment for every agent process. The driver and Sunshine open the display that DISPLAY names, so a screenshot, an input event and the remote desktop stream all use the agent display, and a program that an agent starts opens there. The per-display overlays are OpenBot windows, so with an agent display they are not started: nothing draws the agent cursor or the rim there. capture_screen and list_capture_sources use Electron's desktopCapturer, which sees only the OpenBot display, so with an agent display they are not available, and agents take screenshots with the driver.

openbot.service holds the Xvfb displays too, and a stop signals each process of the unit at the same time. An Xvfb that stops first ends OpenBot before it closes its database. So the unit's ExecStop runs openbot-hosted-server --stop: it sends SIGTERM to OpenBot only, whose PID the script writes to $XDG_RUNTIME_DIR/openbot.pid, and waits for it. Then it waits at most 10 s for the main process of the unit, so that xvfb-run completes its xauth remove. An xauth that the stop signal ended left the ~/.Xauthority-c lock, and each later start failed after 20 to 40 s. The start also removes these lock files when no xauth of the user runs. The container does not need this: tini signals only OpenBot.

Because the driver draws no cursor, its motion styles do not apply. The renderer plays the driver's adaptive style itself (agent-cursor-motion.ts, a port of the driver's trajectory.rs): a Fitts min-jerk glide, or a wide swoop for a move over 900 points. The tap does not delay a request, so the cursor shows where an action went, from 180 ms to about 1.1 s after the driver acts.

On macOS the daemon gets CUA_DRIVER_KEEP_DISPLAY_AWAKE=0, and OpenBot keeps the display awake itself. The tap starts before the daemon, and the daemon gets the variable only when the tap listens: without the tap, provider calls go to the daemon directly and OpenBot cannot see them, so the driver's guard stays on. The driver's own guard holds PreventUserIdleDisplaySleep until 600 s after the last tool call, and end_session counts as a call, so the display stayed on for up to 10 minutes after the agent stopped, against the user's display sleep setting. The tap reports each provider tool call. ComputerUseDisplayAwake (computer-use-display-awake.ts) then holds Electron's prevent-display-sleep blocker, the same assertion, from each call. A turn-completed event without continues releases it when no turn runs, so the hold stays between the turns of one task, and it is always released 600 s after the last call, as the driver's guard was. A call outside a turn, such as background provider work, thus keeps the driver's hold time, and the display never stays on longer than before. The guard exists because display sleep locks the session, and a locked session gives Computer Use no windows and no input. OpenBot's own list_windows reads for the highlight go to the daemon socket, not to the tap, so they take no hold.

Every copy OpenBot starts gets CUA_DRIVER_RS_TELEMETRY_ENABLED=0 and CUA_DRIVER_RS_UPDATE_CHECK=0. OpenBot ships the driver, so its vendor analytics are not something a user chose, and OpenBot pins the version, so a release check could only offer an update OpenBot would refuse.

Remote desktop permission checks and live tests

RemoteScreenGateway owns setup checks and live-test session ownership. The optional remote-desktop-setup Team API capability uses separate v4 adapter routes; released codecs remain unchanged. Diagnostics contain host/account names and permission results and travel only to an authenticated member. They do not include Sunshine credentials or screen content. The renderer opens macOS settings only through fixed local IPC actions.

Sunshine checks its own macOS permissions and hosts the temporary native test panel. During a test, native input is restricted to that panel and tagged for the test. The panel requires both the test tag and the Sunshine process ID before recording a click or keyboard result. The gateway rejects additional sessions and display switches during a test and closes the panel when its owning stream disconnects. It does not interrupt another member's session to start a test.

Local tests use a temporary HTTP listener bound to 127.0.0.1, without publishing the host or requiring an account. The same single-use viewer grant and cookie checks protect it. The gateway owns the listener and closes it with the test session; its lease expires after three minutes. Local test IPC can address only sessions created for this purpose.

A local video-only test can run without native diagnostics. Its viewer iframe is inert and excluded from keyboard focus; it does not start a native input test or report input success. Local loopback test cookies use HttpOnly, Secure and SameSite=None so the embedded viewer works across the app origin.

A paste in the viewer puts the member's text on the host's clipboard, and then presses the host's paste keys. Moonlight sends Cmd+V or Ctrl+V as keys and cancels them, so the browser fires no paste event and the host pastes its own clipboard. The gateway adds openbot-paste.js to Moonlight's stream.html. The script keeps the member's paste key from Moonlight, reads the paste event, and posts the text to moonlight/openbot-clipboard. Both routes are under moonlight/ because the released Team API adapters forward only that family of viewer routes. The same viewer cookie or WebRTC session check protects them, and the clipboard route refuses a request from another site. At the paste event, the script presses the host's paste modifier, Cmd for a macOS host or Ctrl for other hosts, and releases the member's other held modifiers except Shift. A Win or Super key released with no key between would open the host's Start menu or Activities. After the upload, the script presses V. Text that the host already has from an earlier paste is not sent again, so a copy made on the host stays on its clipboard. A host with no clipboard writer serves neither route.

The same script watches the stream. Moonlight's viewer says "connected" when the video track arrives, before a frame, and neither Moonlight Web nor Sunshine can lower the rate during a stream. On a connection slower than the stream, each lost frame makes the streamer wait for a full frame, which the connection loses again, so the picture stays black or frozen (#11271). The script counts the frames that the browser decodes (framesDecoded of Moonlight's peer connection). Sunshine sends at least half the frame rate, also for a still screen, so no frame for 20 s is a stall, or 60 s before the first frame, as the viewer's own stream check waits. The script judges only while the page shows, a peer connection is up, and the browser reports video. It then reports error with a text that says the connection is too slow, and connected again when frames come back. When Moonlight already reported its own error, such as for a host that stopped, the script stays quiet, so that text stays and the quality does not change. In the desktop app and the browser, a stall also sets Moonlight's bitrate and fps to the phone app's Data saver values (3 Mbit/s, 30 fps) for the streams of that server in the next 24 hours, so Retry shows a picture. The key holds the server ID, because one viewer origin shows all joined servers. The phone app keeps the quality from its menu. A Windows host lets Sunshine pick a hardware encoder, and some hardware encoders (AMD AMF on some drivers) pass Sunshine's start probe but never send a frame that the viewer can decode (#14210). When no frame came before the stall, the viewer is the only session of a Windows host, and that host does not use the software encoder yet, the text says that the next connection uses a different video setting, and the script sends noPicture with the error report. The host then writes the sunshine-software-encoder marker, with an expiry 7 days later, in the runtime state folder. Retry closes the only session, so the runtime stops, and the next Sunshine start writes encoder = software. The expiry lets a host go back to the hardware encoder after a false alarm, such as a slow link, or after a driver update. With more than one session, the host does not change the encoder: another member may see a picture, and Sunshine does not restart for them. scripts/remote-desktop-no-picture-e2e.ts checks this through the real gateway in a browser. The host serves this script also when it has no clipboard writer, but then without the paste part.

The same script also keeps keys from staying down on the host when the viewer runs on a Mac or an iPad (#3766). macOS browsers often send no keyup for a key that is released while Cmd is held. Moonlight then keeps the key down, and Sunshine repeats it 25 times each second until another key goes down. The script sends a key pressed with Cmd as a tap: Moonlight gets the real keydown, and then a keyup at the next task. When Cmd is released, the script releases each other key that it still sees as held. When a held key goes down again without repeat, the script releases it first, so the new press reaches the host. A held Cmd shortcut still repeats, because each browser repeat is another tap. The script reads only trusted events and runs after the paste part, so the paste key keeps its path. Other viewers do not change.

On Linux, the gateway accepts only an X11 session (DISPLAY set, no WAYLAND_DISPLAY, and XDG_SESSION_TYPE not wayland). Sunshine then runs with X11 capture and software encoding, and sends input through XTest, so a hosted server under Xvfb needs no uinput device and no extra capability. On a server with an agent display, Sunshine runs on that display (see Agent display on a server). Linux has no permission checks: an X11 session is ready.

Host controls

The host owner chooses in Server settings › Remote desktop which roles may start a session (owner, admins or members; members by default) and whether the person at the computer must allow each session. The section shows for the local server on every platform; the client setup steps in it stay macOS only. remote-control-policy-store.ts keeps both settings in a JSON file in userData, as the Private network setting does. The route checks the role on sessions, setup, test and display: a new display restarts every open stream.

remote-control-question.ts asks with a sheet on the main window. A request is refused when nobody allows it in 30 s, when a revoke or Stop all ends it, or when a client on a direct HTTP connection drops it. A WebRTC client has no cancel frame, so its question stays until an answer or the 30 s end. A released desktop client on direct HTTP stops waiting after 15 s. After Allow, the runtime can take seconds to start; a revoke or Stop all in that time also refuses the request. A host with no window refuses every session while the question is on. Both refusals are a 403 with a localized message and no code: every released protocol rejects an error code it does not know.

The gateway's audit events show the sign: a notification at the first stream of a remote session, and the tray item with the member's name and Stop all remote control while the session exists. A session with no viewer stream for 60 s ends, so a client that leaves without a close does not keep its slot. The 60 s start again at each viewer request, so a slow first load, a display switch or a short reconnect keeps the session. A local test session does not count.

An extra server on the same computer (local-server-child.ts) runs its own gateway with its own policy file and no question, tray or notification. Its members are not covered by the desktop's settings.

Remote desktop on the phone

The mobile app shows the host's own Moonlight Web viewer, as the desktop app does (apps/mobile/src/features/remote-desktop). The viewer is code from the host, so it runs in a plain react-native-webview, not in an Expo DOM component: the web view has no onMessage, loads only its loopback address, and cannot call the app. The app calls the page with injectJavaScript.

  • modules/remote-viewer-proxy is a native HTTP and WebSocket server on 127.0.0.1 (Swift and Kotlin). It answers 404 to a path without the session's random token and reads only HTTP and WebSocket frames. viewer-proxy.ts sends each request to the host as a Team API request, and rewrites /v1/remote-screen in HTML and JavaScript as RemoteViewerProxy does on desktop. It takes only the routes of its own session.
  • The viewer's signaling socket goes over the peer's desktop channel. The hidden peer page (remote-desktop-relay.ts) relays it with the remote-stream-v1 frames; the browser live view reads the same channel and leaves frames of other streams alone.
  • The proxy reads the viewer's viewer-state reports on their way to the host, so the screen knows when the first frame arrives (the desktop's 60 s limit) and whether the video is direct or relayed. A failure report does not close the page: after a display change the host closes the stream socket with 4410, and the viewer loads again by itself. During a display change the screen says "Switching to …" and keeps the old stream's end report. It shows that report, or a switch failure, only when the new stream shows no picture within 30 s.
  • The app's page script sets Moonlight's mlSettings before the page starts: H.264, a stream no wider than 1920 px (Fast, 120 fps, 20 Mbit/s; Smooth, 60 fps, 10 Mbit/s) or 1280 px (Data saver, 30 fps, 3 Mbit/s), and Moonlight's mouseRelative (Trackpad mode) or pointAndDrag touch mode. Sunshine on macOS captures no faster than the display, so Fast sends more frames only from a display of 120 Hz or more. The script also puts the app's background in place of Moonlight's blue page, which is a body::before layer, and hides Moonlight's stats overlay.
  • Connection stats is a sheet. While it is open, the page posts Moonlight's stats once a second to moonlight/openbot-phone-stats. The proxy answers that one path itself and sends it to no host, so the page gets no other way to reach the app. Moonlight's WebRTC values named "…Ms" are running totals in seconds, so the sheet shows the time per frame from the change between two samples. Copy in the sheet's header copies the shown values and Moonlight's raw values. OpenBot's patch hides Moonlight's sidebar, so the app adds a key bar above the phone keyboard.
  • Typing sends keydown and keyup of a US keyboard to the document, as the paste script does. Sunshine on macOS does not type text ("Unicode input not yet implemented for MacOS"), so only a character with no key goes through Moonlight's sendText, which Windows and Linux hosts type.
  • Zoom is a transform of Moonlight's .video-stream element. That element is position: fixed, so a transform of a parent would move it out of view. Moonlight's page animates every transform for 0.25 s, so the script turns off the video's transition: each pan step reads the video's place, and a place in mid-animation made the view drift. Moonlight maps a touch through the video's bounding box, so a touch lands where the finger is.
  • Trackpad mode is Moonlight's localCursor touch mode: the finger moves the pointer as on a trackpad, and Moonlight sends the pointer's position, so the page knows it. While zoomed in, the view follows the pointer when the pointer moves near an edge or under the app's bars. A view that the fingers moved away from the pointer stays there until the pointer moves. Moonlight's own pointer drawing is hidden, because the computer's pointer is in the video. A pinch zooms and moves the view with the fingers; three fingers move the view. For a gesture that the view takes, the script calls Moonlight's onTouchCancel, so a finger that Moonlight saw first does not click. At any zoom, a two-finger drag scrolls the computer and a two-finger tap right-clicks.
  • Before a session the phone asks for Face ID, Touch ID or the phone unlock. It ends the session when the app leaves the foreground, covers the screen in the app switcher, keeps the phone awake, and sets FLAG_SECURE on Android.

Codex tool approvals

Codex saves an “Always allow” tool decision only when the MCP server is in a file-backed configuration layer. A thread configuration alone does not satisfy this check. Before starting or resuming a thread with Computer Use, OpenBot registers computer_use in the Codex user configuration through config/batchWrite. The new entry contains only a placeholder command (openbot-mcp) and enabled = false. The write uses the user layer's version, and an existing entry is left unchanged. OpenBot does not save the driver socket, environment, or credentials in that entry.

The thread configuration enables the running driver and supplies its current command, arguments, and environment. It also carries the saved per-tool settings, including set_value.approval_mode. Saved tool settings are also in the session fingerprint. When an approval changes, the next turn replaces a loaded provider session that holds the old policy. An agent with Full access does not ask: OpenBot accepts each Computer Use tool consent once and saves nothing, as it does for other MCP tools. A Workspace only or Ask first agent shows the card, and Codex keeps "Always allow" per tool and per provider account. When Computer Use is off for the agent or the driver is unavailable, the thread keeps the saved entry disabled. A registration failure stops the thread with steps to repair the configuration or turn off Computer Use. The application-access questions from the driver still use their existing approval flow.

Codex's own Computer Use

Codex loads its bundled Computer Use plugins by default (computer-use@openai-bundled, which starts node_repl and cua_node, and unified-computer-use@openai-bundled). A session without Computer Use sets plugins.<id>.enabled = false for both in the thread configuration: an agent with the setting off, or a task thread beside the agent's own chat. Routine and channel threads keep the agent's setting. The thread value wins over the user's own Codex file. Codex (0.160 to 0.170) does not read features.computer_use, so OpenBot does not use it. A loaded session keeps the plugins of its start, so the session fingerprint has a value for a session without Computer Use. The next turn replaces a session from before, and a session whose setting changed, with the usual handoff.

Every Codex session also sets plugins.<id>.enabled = false for Codex's bundled browser plugins (browser, chrome, chrome-dev and chrome-internal, all @openai-bundled). These plugins need a browser access host that only the ChatGPT desktop app gives to the sessions that it starts. In an OpenBot session, each call fails with "The browser access host is unavailable" (openai/codex#57641). Agents use the OpenBot browser, or the user's Chrome through the OpenBot extension. The value does not change, so it is not in the session fingerprint: a resumed session gets it, and no session is replaced.