Skip to content

feat(cua-computer): add experimental Windows/Linux computer-use fulfiller#112267

Merged
steipete merged 2 commits into
mainfrom
claude/cua-computer-plugin
Jul 21, 2026
Merged

feat(cua-computer): add experimental Windows/Linux computer-use fulfiller#112267
steipete merged 2 commits into
mainfrom
claude/cua-computer-plugin

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenClaw's computer use has a platform-neutral contract (capability-based since #112107) but only one fulfiller: the macOS app's embedded Peekaboo service. Windows and Linux desktops cannot be driven at all. This PR adds the first cross-platform fulfiller as a bundled plugin, cua-computer, backed by trycua/cua's cua-driver daemon (Rust; UIA on Windows, X11/AT-SPI on Linux).

Why This Change Was Made

Design follows the repo's owner-boundary rules: core stays cua-agnostic. The plugin registers screen.snapshot + computer.act node-host commands (the linux-canvas pattern) so a headless openclaw node run host in a Windows/Linux desktop session advertises them; gateway pairing/arming policy already accepts desktop platforms declaring these since #112107. Implementation notes, all grounded in cua-driver 0.10.0 source (contract extraction with file:line citations in the PR discussion):

  • Speaks MCP over stdio to a supervised cua-driver mcp child; spawns cua-driver serve first on Linux/Windows (upstream only auto-starts the daemon on macOS). Telemetry (CUA_DRIVER_RS_TELEMETRY_ENABLED) and update checks are forced off for OpenClaw-managed processes.
  • Version-gated: exact-minor pin (0.10.x) + capability_version/schema_version "1" at handshake; anything else refuses with a typed error. Upstream is prerelease with fast churn — the pin turns churn into a visible refusal, not silent breakage.
  • displayFrameId is synthesized (geometry + daemon-generation hash) because upstream exposes no stable display identity; coordinate actions verify the echoed token AND re-check live geometry via get_screen_size before injecting, preserving the frame-binding invariant. Screenshots are downscaled to the reference width via rastermill (plugin-local dep) so delivered dimensions equal the coordinate space.
  • Honest v1 limitations, enforced as typed errors: primary display only; hold_key/left_mouse_down/left_mouse_up unsupported (upstream has no desktop-scope hold API); macOS never available (Peekaboo owns it); native Wayland only via upstream's own opt-in env, KDE unsupported upstream.

User Impact

New opt-in capability (plugin enabledByDefault: false): with cua-driver 0.10.x installed and the plugin enabled, a paired Windows or Linux X11 node can be driven by the computer tool under the exact same pairing, arming, frame-binding, and vision-model gates as macOS. Nothing changes for users who don't enable it.

Evidence

  • Focused tests: node scripts/run-vitest.mjs extensions/cua-computer (mapping tables, frame staleness/geometry drift, refusal codes, version gate, serialization, availability gating) plus unchanged green computer-tool and node-command-policy suites.
  • Contract grounding: cua-driver 0.10.0 tool schemas, refusal codes, session/cleanup semantics, and daemon lifecycle extracted from upstream source at tag cua-driver-rs-v0.10.0 with per-claim file:line citations.
  • CI on head SHA; details in checks.

Review hardening

This PR went through an extended adversarial autoreview (13 rounds). Two genuine P1 security issues were caught and fixed before land: the initial code copied the entire process environment into the daemon (secret leak), and an interim allowlist fix was itself too broad (CUA_ prefix would forward CUA_API_KEY). Both are now closed with a deny-by-default exact allowlist plus a regression test. Several coordinate-space and delivery-mode findings were verified against cua-driver 0.10 source and rejected as source-contradicted (desktop scope is global/foreground and ignores delivery_mode; press_key applies modifiers on Wayland by internal hotkey promotion; screen and screenshot geometry are equal on all supported backends) — with clarifying invariant comments added so they are not re-flagged.

@steipete
steipete marked this pull request as ready for review July 21, 2026 11:36
@steipete
steipete requested a review from a team as a code owner July 21, 2026 11:36
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XL maintainer Maintainer-authored PR labels Jul 21, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/cua-computer/package.json
  • pnpm-lock.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: 76a36ed55a3f06b6ef31acd1ac99b0e165b4b6a5
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(cua-computer): add experimental Windows/Linux computer-use fulfiller This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

steipete added 2 commits July 21, 2026 04:54
…ller

Bundled plugin that fulfills the capability-based computer.act + screen.snapshot
node contract on Windows and Linux by supervising a pinned cua-driver 0.10.x
daemon over MCP stdio. macOS keeps the Peekaboo fulfiller; this plugin is
disabled by default and never available on darwin.

Grounded in cua-driver 0.10.0 source (tool schemas, refusal codes, coordinate
spaces, session/daemon lifecycle). Notable safety and correctness properties:
- Deny-by-default env allowlist so OpenClaw secrets (provider/channel tokens,
  CUA_API_KEY) never reach the separately installed daemon; telemetry and
  update checks forced off.
- Version-gated handshake (exact-minor pin + capability/schema version),
  time-bounded so a corrected driver recovers without a node restart.
- Robust daemon supervision: full readiness-budget polling, startup-race
  tolerance, signal-death and spawn-error recovery, shared-daemon lifecycle
  (never killed on dispose).
- Frame authorization preserved within upstream limits (generation + full live
  geometry; capture refused when screen and screenshot geometry diverge).
- Action mapping refuses inputs cua-driver cannot faithfully deliver:
  layout-shifted keys, modifier-held drag/scroll, Linux modifier clicks,
  hold_key/mouse down-up, non-positive scroll; drag duration clamped.
@steipete
steipete force-pushed the claude/cua-computer-plugin branch from 99b9cab to 76a36ed Compare July 21, 2026 11:54
@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(cua-computer): add experimental Windows/Linux computer-use fulfiller This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification (maintainer-directed landing):

Work done: first cross-platform (Windows/Linux) computer-use fulfiller as the bundled cua-computer plugin, supervising a pinned cua-driver 0.10.x daemon over MCP. Disabled by default; never available on macOS (Peekaboo owns it).

Local proof (trusted source, focused):

  • node scripts/run-vitest.mjs extensions/cua-computer — 81 passed
  • node scripts/run-vitest.mjs src/agents/tools/computer-tool.test.ts src/gateway/node-command-policy.test.ts — unchanged, green
  • Local gate parity after the first CI run surfaced failures: oxlint clean, pnpm check:test-types clean, pnpm deadcode:dependencies/deadcode:exports clean, pnpm docs:map:check up to date
  • Structured autoreview (Codex): clean on the final delta; 13 review rounds total, two P1 credential-exposure issues caught and fixed (full-env inheritance, then an over-broad CUA_ prefix that would forward CUA_API_KEY), several coordinate-space/delivery findings verified against cua-driver source and rejected as source-contradicted with invariant comments added

Hosted proof: full CI green on head 76a36ed55a3f06b6ef31acd1ac99b0e165b4b6a5 including openclaw/ci-gate; scripts/pr prepare-run (OPENCLAW_TESTBOX=1) completed with prep head == PR head.

Known proof gaps:

  • The ClawSweeper review worker acquired its lease on this head but died before posting a review (lease expired 2026-07-21T12:38Z, placeholder never replaced). No Rank-up moves were posted, so none are outstanding; landing does not bypass any posted moves.
  • No live cua-driver end-to-end run. The tool contract is validated against cua-driver 0.10.0 upstream source with file:line citations; live Windows/Linux X11 proof via Crabbox is the planned follow-up phase.

@steipete
steipete merged commit f695be3 into main Jul 21, 2026
111 checks passed
@steipete
steipete deleted the claude/cua-computer-plugin branch July 21, 2026 12:58
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 22, 2026
…ller (openclaw#112267)

* feat(cua-computer): add experimental Windows/Linux computer-use fulfiller

Bundled plugin that fulfills the capability-based computer.act + screen.snapshot
node contract on Windows and Linux by supervising a pinned cua-driver 0.10.x
daemon over MCP stdio. macOS keeps the Peekaboo fulfiller; this plugin is
disabled by default and never available on darwin.

Grounded in cua-driver 0.10.0 source (tool schemas, refusal codes, coordinate
spaces, session/daemon lifecycle). Notable safety and correctness properties:
- Deny-by-default env allowlist so OpenClaw secrets (provider/channel tokens,
  CUA_API_KEY) never reach the separately installed daemon; telemetry and
  update checks forced off.
- Version-gated handshake (exact-minor pin + capability/schema version),
  time-bounded so a corrected driver recovers without a node restart.
- Robust daemon supervision: full readiness-budget polling, startup-race
  tolerance, signal-death and spawn-error recovery, shared-daemon lifecycle
  (never killed on dispose).
- Frame authorization preserved within upstream limits (generation + full live
  geometry; capture refused when screen and screenshot geometry diverge).
- Action mapping refuses inputs cua-driver cannot faithfully deliver:
  layout-shifted keys, modifier-held drag/scroll, Linux modifier clicks,
  hold_key/mouse down-up, non-positive scroll; drag duration clamped.

* fix(cua-computer): satisfy lint, test-types, dead-code, and docs-map gates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation maintainer Maintainer-authored PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant