Add `/computer-use` desktop sandboxes to Pax
Why we make these changes
Pydantic AI Harness has ComputerUse and desktop=True on every sandbox backend. This PR lets Pax use it: /computer-use gives the model a desktop in its /sandbox, and the status row shows watch live ↗, a click opening the provider's own link to watch it, where the provider has one.
New public surface
StatusLink(text=, url=) in pydantic_ai_pax.ui.rendering.status: a plugin status segment may return one to show a clickable link (documented in PLUGINS.md). Also the /computer-use command on the built-in sandbox plugin, and SupportsDesktopUrl beside the internal SandboxProvider protocol.
User-visible behavior
/computer-use # turn it on (before /sandbox, or inside a sandboxed conversation)
/sandbox daytona # makes the sandbox with a desktop; the footer shows `daytona sandbox | watch live ↗`
/computer-use off # the model loses the `computer` tool; the sandbox keeps running
/sandbox delete # deletes the sandbox
- Where a provider can add a desktop to a running sandbox (boxd, daytona, local smol, render, sprites, kubernetes),
/computer-useworks at once, also after turns have run. - Where it can only make one at create (e2b, modal, local boxlite), Pax says to run
/sandbox delete,/new,/computer-use, then/sandbox PROVIDER. It never deletes the sandbox itself, since a fork or copy of the conversation may use it. opensandboxoffers no desktop: installing one needs Debian's package servers, which its GitHub-only network policy blocks, so/computer-userefuses there.- Whether computer use is on is saved in each response's metadata, so
/resumeand compaction keep it. A sandbox that had a desktop keeps it after/computer-use off, so turning it back on needs no new sandbox. - The model gets the
computertool only under/permissions full, checked at each step, as harness offers none on a read-only workspace. Under another mode the instructions,/computer-useand/sandboxsay the desktop needs/permissions full. - While computer use is on, the status row shows
watch live ↗next to the sandbox. Full screen, a click opens it with Pax'sopen_browser(pinned rows only,http(s)only; transcript links are not captured). Inline, the footer carries it as an OSC 8 hyperlink, and a footer cut inside the link closes it. - The segment runs every frame, so it only reads a link cached on the sandbox. Pax mints it at
/computer-use on,/sandbox PROVIDERwith computer use armed,on_session_start,on_conversation_changedandon_turn_start, only when there is none or (Daytona, 1 hour) it is over 50 minutes old, and hides it once expired. A failed mint logs a warning and leaves the segment empty. While the link shows,(computer-use)is dropped from the sandbox segment. - There is no
/computer-use view: the status row's link replaces it. Pax runs no viewer of its own.
Removed: Pax's own desktop viewer
An earlier version of this PR served a loopback viewer (sandbox/viewer.py and viewer.html) with its own token, CSP and SSE stream, split the web UI's access check into web/guard.py to share it, added a Desktop side panel and a watch live ↗ link on computer rows, and kept screenshot frames for it. All of that is gone, and web/app.py is as on main. It was a second local server to secure and maintain for something the providers that have a desktop link already give. The PR is now about 870 lines smaller.
Which providers have a desktop link
A provider is listed only if its link opens the desktop in a plain browser with nothing relayed by Pax. Checked against the installed SDKs and the harness backends, and live on 2026-11-25 (each probe sandbox deleted):
| Provider | Link | Evidence |
|---|---|---|
| boxd | yes: Machine.access.desktop_url, the console's Desktop view | boxd 0.3.4 models.py MachineAccess.desktop_url ("needs a signed-in browser"). Live: GET https://app.<zone>/desktop/<machine> returned 200. It opens only for the owner's boxd login. |
| daytona | yes: create_signed_preview_url(6080, expires_in_seconds=3600) + /vnc.html?autoconnect=1 | daytona 0.226.1 create_signed_preview_url puts the token in the host name. Live: vnc.html returned 200 (noVNC), /websockify answered RFB 003.008 with no password, and after expiry a new load returned 401 while an open socket stayed connected. Also checked through the status row link in uv run pax (see Verification). |
| e2b | no | Pax creates sandboxes with allow_public_traffic: False, so port URLs need the e2b-traffic-access-token header, and the harness desktop is Xvfb with no VNC server. |
| modal, render, sprites, opensandbox, kubernetes | no | No desktop or VNC API in their SDKs (modal 1.6.3, render 1.6.0, sprites-py 0.7.1, opensandbox 1.1.1, k8s-agent-sandbox 1.0.11); the harness desktop is Xvfb driven by xdotool, with no server a browser could reach. |
| local smol, local boxlite | no | Same Xvfb desktop. BoxLite's ComputerBox has a web desktop, but Pax uses BoxLiteSandboxBackend on python:3.13, not that image. |
Verification
tests/pax/test_computer_use.pycovers toggling, the refusal to replace a sandbox, resume and compaction, and thecomputertool only underfull: after a mid-turn change toauto, the next request offers neither thecomputerfunction tool nor the nativeComputerTool(core's_drop_unrunnable_computer_toolleaves out an optionalComputerToolonce nocomputerfunction tool is left, so Pax'sprepare_toolsfilter gates both).test_sandbox.pycovers boxd's and Daytona'sdesktop_urlthrough the harness SDK fakes, and each provider'sreopen(desktop=True)wiring.- Ran
test_computer_use.py,test_sandbox.py,test_live_prompt.py,test_prompt_surface.pyandtest_status.py(-n 2), ruff and strict pyright on the touched files,scripts/check_complexity.pyandscripts/check_test_waits.py. test_computer_use.pyalso covers the status row: the link after/computer-use onand on resume, none for a provider without one, renewal at 50 minutes and hiding after expiry, and a failed mint.test_live_prompt.py,test_prompt_surface.pyandtest_status.pycover the footer click, the inline OSC 8 output, a truncated footer closing its link, wide-character columns, and http(s)-only pinned clicks. Every changed line is covered.- Live in
uv run paxin tmux against Daytona (2026-11-25), withBROWSERpointed at a logging script: inline, the footer showeddaytona sandbox | watch live ↗with an OSC 8 link that returned 200 (noVNC); after a resize to full screen, an SGR mouse click onwatch live ↗sent the link toBROWSER, and it returned 200. The sandbox was deleted. - The status-row link code is ported from closed https://github.com/pydantic/pydantic-ai/pull/14587, without its viewer,
file://page or transcript link capture.
What changes for existing users
Nothing unless they run /computer-use. Sandbox refs are unchanged, so existing sandboxed conversations resume as before.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.