Skip to content

feat(drivers): agent-desktop on Linux, on an X11Driver base the reference driver shares - #516

Merged
earakely-scale merged 5 commits into
mainfrom
fd-5306-agent-desktop-linux
Nov 6, 2026
Merged

earakely-scale merged 5 commits into
mainfrom
fd-5306-agent-desktop-linux

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

agent-desktop now runs as a computer driver on an X11 desktop on Linux (amd64 and arm64), as well as on macOS. It's the second driver the Cua Driver Bench can run on Linux, beside cua-driver.

  • A shared X11 base. The reference driver's computer/v1 implementation moves, unchanged, into agentenv_protocol.computer._x11.X11Driver, behind a new x11 extra (mss, python-xlib). This mirrors MacOSDriver on macOS. The reference driver becomes a thin subclass, and agent-desktop builds on the same base.
  • agent-desktop on Linux:
    • It installs the 1.2.0 Linux tarball for its arch, checked by sha256. On Linux the unpack runs as root, which owns the driver's folder.
    • It declares linux/x11 on amd64 and arm64, and pins the sha256 of both Linux executables (agent-desktop and agent-desktop-linux-clipboard-owner) per arch.
    • The process gets the session's display and bus, where it finds AT-SPI.
    • Linux's agent-desktop mcp says and lists exactly what macOS's does (the same instructions and 67 tools), so one mcp.json pins both.
    • Like cua-driver, the driver chooses its OS base at import.
  • Pins. The X11 drivers pin the protocol at the workspace's version, which a checkout builds from and a release repins.

Testing

  • The drivers, serialization, bundle and protocol unit tests pass on an EC2 Ubuntu box: 2,575 passed. The agent-desktop driver's tests now run once per OS.
  • The bench's four Linux computers with agent-desktop compose and pass gate 3's full probe on EC2.
  • A full Claude Sonnet 5.5 run of Cua Driver Bench v2 through agent-desktop on Linux runs from this branch: 90 trials on 32 workers, published to CuaDriverBench-AgentEnv.

FD-5306

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the previous test-coverage finding is addressed.

Summary

The PR adds Linux support for agent-desktop and moves the reference driver's X11 code into the shared X11Driver base.

  • Agent-desktop now runs on Linux X11 as well as macOS.
  • Linux X11 computer operations now live in a shared protocol base.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Reference[ReferenceDriver] --> X11[X11Driver]
  Linux[AgentDesktop on Linux] --> X11
  Mac[AgentDesktop on macOS] --> MacBase[MacOSDriver]
  Linux --> MCP[agent-desktop MCP tools]
  Mac --> MCP
Loading

Reviews (2) · Last reviewed commit: "test(drivers): agent-desktop's server ge..." · Reviewed by Greptile

earakely-scale and others added 3 commits November 6, 2026 08:40
…ence driver shares

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s version, which a checkout builds from

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns the driver's folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 6, 2026 17:11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +93 to +94
if request.param == "linux":
_fake_x11(monkeypatch)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Linux session values go unchecked

The new Linux cases never set or check DISPLAY, XAUTHORITY, DBUS_SESSION_BUS_ADDRESS, or XDG_RUNTIME_DIR. Removing these names from KEPT would still pass the tests, even though the child process could lose access to the desktop or AT-SPI.

Set distinct values in the Linux fixture and assert that the fake child receives them. Keep the existing assertion that excludes the control token.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tst/unit/drivers/agent_desktop_driver_test.py
Line: 93-94

Comment:
**Linux session values go unchecked**

The new Linux cases never set or check `DISPLAY`, `XAUTHORITY`, `DBUS_SESSION_BUS_ADDRESS`, or `XDG_RUNTIME_DIR`. Removing these names from `KEPT` would still pass the tests, even though the child process could lose access to the desktop or AT-SPI.

Set distinct values in the Linux fixture and assert that the fake child receives them. Keep the existing assertion that excludes the control token.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Cursor Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b7631b2: the fixture sets each of DISPLAY, XAUTHORITY, DBUS_SESSION_BUS_ADDRESS and XDG_RUNTIME_DIR, and test_a_call_reaches_a_server_of_its_own_headed_when_the_setting_says_with_none_of_the_drivers_environment asserts the fake server receives all four on Linux and none of them on macOS.

…y and bus, and not on macOS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 8531099 into main Nov 6, 2026
52 checks passed
@earakely-scale
earakely-scale deleted the fd-5306-agent-desktop-linux branch November 6, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant