Skip to content

feat(cua-computer): full v2 adapter with background window/element delivery - #123604

Merged
steipete merged 2 commits into
mainfrom
steipete/cu-cua-v2-adapter
Aug 14, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/cu-cua-v2-adapter

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #123464, #123469, #123509, #123544

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What Problem This Solves

The Windows/Linux CUA plugin still exposed only the foreground desktop-coordinate subset after the v2 computer-use contract and provider seam landed. Models could not discover applications or windows, observe accessibility elements, target a background window or element, use app lifecycle/menu/value/zoom actions, or consume the driver's structured delivery and escalation evidence.

Campaign plan: #123464 (docs/plan/computer-use.md). This is W2-CUA on top of the parity fixtures (#123469), provider seam (#123509), and v2 contract/tool (#123544).

Why This Change Was Made

This extends the existing provider in place. Desktop-coordinate calls keep their direct typed SDK path, while v2 window and element calls use the same immutable trusted CUA session through callTool. Opaque application, window, observation, and element references are execution- and generation-bound; driver rotation invalidates them. The adapter projects driver images, accessibility elements, action effects, delivery evidence, refusals, and escalation recommendations into the frozen v2 result envelope.

Browser and recording families remain unadvertised and their feature flags remain false. This PR does not change macOS behavior, the node protocol, or the trusted createConfigured authorization ceiling.

Capability descriptor

Surface Windows Linux
Actions 23 implemented actions 25 implemented actions (adds left_mouse_down / left_mouse_up)
Targets screen, window, element screen, window, element
Delivery background, foreground background, foreground
Observations image, accessibility image, accessibility
Recording / agent cursor / multi-display false / false / false false / false / false

Implemented families: desktop screenshot and coordinate actions; app/window/accessibility/cursor discovery; window image + element observation; launch/kill/front; background window/element click, drag, scroll, type, key, and Linux held-button delivery; set value; menu invocation; zoom; explicit scope escalation.

Dependency contract checked

Pinned @trycua/cua-driver 0.19.3 declarations used directly:

  • cua_driver_sdk.d.ts:10,23-55,317-355 — immutable trusted-session factory/options and ToolResult structured/action envelopes.
  • cua_driver_sdk.d.ts:2014-2069,2304-2375 — generic callTool, session lifecycle/escalation, typed desktop tools, and explicit close.
  • cua_driver_contract.d.ts:2-89 — delivery, effect, evidence, route, and escalation enums/records.
  • cua_driver_contract.d.ts:626-653,755-793 — Window/Desktop capture scope, escalation state, and start-session semantics.

The exact per-platform JSON tool schemas and result records were also checked against immutable upstream commit a1672e7b11951275ecfba3384264d4530185d0db (the 0.19.3 release commit); the regression fixtures record only bounded portable projections.

User Impact

On a Windows or Linux paired node, the computer tool can now stay background-first: list apps/windows, observe a selected window with its image and accessibility elements, act by opaque element or window-pixel reference without stealing focus, and react to confirmed/unverifiable/no-op and escalation evidence without an extra desktop screenshot when the driver already returned an observation.

Linux and Windows advertise only their actually implemented action set. Existing desktop screenshot/coordinate requests keep the prior wire arguments and result bytes.

Evidence

  • node scripts/run-vitest.mjs extensions/cua-computer src/plugins/computer-use-contract.test.ts — 69 tests passed across 2 shards.
  • Source-blind fixture-backed behavior validation: all 15 provider contract checks passed, including platform capabilities, full targeted pointer/keyboard mapping, lifecycle, refusal prefixing, evidence projection, and generation staleness.
  • pnpm check:test-types — passed.
  • pnpm tsgo — passed.
  • node scripts/run-oxlint.mjs extensions/cua-computer — passed.
  • pnpm deadcode:full — passed with zero unused exports.
  • node scripts/check-import-cycles.ts — 0 runtime value cycles.
  • node scripts/check-changed.mjs — complete extension + extension-test changed gate passed (prod/test typechecks, formatting, lint, boundary guards, dead exports, and cycles).
  • pnpm format <changed files> and git diff --check — clean.
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean, no accepted/actionable findings.

No live driver was required or attempted for this PR, per the work order. Live Linux Xvfb proof remains the W3 integration gate.

LOC split

Class Added Removed Net
Production 1,129 41 +1,088
Tests / fixtures 530 9 +521
Changelog 1 0 +1
Total 1,660 50 +1,610

The positive production delta is the concrete capability boundary: 23/25 truthful v2 actions, session scope management, four opaque-reference lifecycles, result/evidence projection, and bounded cross-platform normalization. The old desktop-only registration/policy branches are not duplicated: commands.ts is net -10 lines and retains only the byte-compatible desktop path plus provider assembly.

@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 14, 2026 10:36
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 6:53 AM ET / 10:53 UTC.

ClawSweeper review

What this changes

The PR expands the Windows/Linux CUA computer-use provider from desktop-coordinate control to v2 window, element, accessibility, lifecycle, and background-delivery actions.

Merge readiness

⛔ Blocked by patch quality or review findings - 5 items remain

Keep open for maintainer review. The protected maintainer label prevents automated cleanup, and the local partial clone could not load the exact PR tree or the directly used CUA driver declarations, so this review cannot verify the two prior P1 fixes or clear the new desktop-control boundary.

Priority: P2
Reviewed head: ac2585c983cdc72013bad0918bcc29c152314c10

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 5 items Current main boundary: Current main keeps wait in the provider descriptor while rejecting it at the wire adapter because core handles it locally; this is the behavior the prior review required the PR to preserve.
Direct dependency signal: The provider imports CUA driver types and dynamically loads @trycua/cua-driver; the PR’s new callTool and escalation behavior therefore depends on that package’s exact contract.
Exact-head inspection blocked: The PR head and base commits are known locally, but reading their trees required a promisor fetch that failed because github.com DNS resolution was unavailable. Exact source and diff verification could not be completed.
Findings None None.
Security Needs attention Verify the CUA session and escalation contract directly: The patch adds driver-mediated window, element, and escalation operations, but the local checkout lacks the pinned declarations and cannot load the PR tree to validate the call shapes and authority boundary.

How this fits together

The CUA plugin is OpenClaw’s paired-node desktop-control provider behind the shared computer tool. It translates model requests into a trusted CUA driver session and returns bounded observations and delivery results to the agent.

flowchart LR
  Agent[Agent computer request] --> Contract[Shared v2 action contract]
  Contract --> Provider[CUA provider]
  Provider --> Session[Trusted CUA session]
  Session --> Driver[Windows or Linux driver]
  Driver --> Projection[Bounded result projection]
  Projection --> Agent
Loading

Before merge

  • Resolve security concern: Verify the CUA session and escalation contract directly - The patch adds driver-mediated window, element, and escalation operations, but the local checkout lacks the pinned declarations and cannot load the PR tree to validate the call shapes and authority boundary.
  • Resolve merge risk (P1) - The exact PR tree and the directly used CUA driver declarations were unavailable locally, so the background-delivery, escalation, and trusted-session changes cannot yet receive an independent contract review.
  • Resolve merge risk (P1) - The PR body reports mocked/fixture validation only and explicitly defers live Linux Xvfb evidence; a real driver run is still needed for the new delivery and recovery paths.
  • Complete next step (P2) - The protected maintainer PR needs exact-head dependency/security review and real-driver proof, not an automated repair branch.
  • Improve patch quality - Resolve the security review concern or explain why the changed path is safe.

Findings

  • [medium] Verify the CUA session and escalation contract directly — extensions/cua-computer/src/driver-client.ts:3
Agent review details

Security

Needs attention: The direct CUA driver contract and exact PR source were unavailable, so the new trusted-session and background-control boundary cannot be cleared.

PR surface

Source +1176, Tests +433. Total +1609 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 6 1217 41 +1176
Tests 2 442 9 +433
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 1659 50 +1609

Review metrics

Metric Value Why it matters
Production versus test delta production +1,088; tests/fixtures +521 The supplied diff statistics show a substantial provider capability expansion that merits exact-head contract and runtime validation.

Stored data model

Persistent data-model change detected: serialized state: extensions/cua-computer/src/cua-driver-contract.test-fixtures.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete contract and driver proof (recommended)
    Review the exact head against the installed 0.19.3 declarations and add real-driver evidence before merge.
  2. Pause the adapter
    Keep the PR open without merging until the planned W3 integration proof is available.

Technical review

Best possible solution:

Restore exact-head and CUA-driver source access, verify the two prior P1 fixes plus session/escalation semantics, then attach redacted real-driver evidence for a window or element background action and escalation recovery.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a defect reproduction: this is a new capability. No high-confidence exact-head real-driver validation path was available in this checkout, and the PR provides only mocked/fixture evidence.

Is this the best way to solve the issue?

Unclear: extending the existing provider seam is the right architectural direction, but exact-head source and the direct CUA dependency contract must be inspected before judging this implementation as the best solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e826501fdb6a.

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🌊 off-meta tidepool and patch quality is 🧂 unranked krab.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.

Label justifications:

  • P2: This is a substantial optional paired-node capability expansion, not a current core-runtime outage.
  • merge-risk: 🚨 compatibility: The PR changes the advertised computer action, target, and delivery capability surface for Windows and Linux nodes.
  • merge-risk: 🚨 security-boundary: New window and element actions are routed through a trusted desktop-control session and require direct driver-contract verification.
  • merge-risk: 🚨 availability: New driver session, generic-tool, and escalation paths can affect execution of paired-node computer actions.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🌊 off-meta tidepool and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

Security concerns:

  • [medium] Verify the CUA session and escalation contract directly — extensions/cua-computer/src/driver-client.ts:3
    The patch adds driver-mediated window, element, and escalation operations, but the local checkout lacks the pinned declarations and cannot load the PR tree to validate the call shapes and authority boundary.
    Confidence: 0.96

What I checked:

  • Current main boundary: Current main keeps wait in the provider descriptor while rejecting it at the wire adapter because core handles it locally; this is the behavior the prior review required the PR to preserve. (extensions/cua-computer/src/commands.ts:258, e826501fdb6a)
  • Direct dependency signal: The provider imports CUA driver types and dynamically loads @trycua/cua-driver; the PR’s new callTool and escalation behavior therefore depends on that package’s exact contract. (extensions/cua-computer/src/driver-client.ts:3, e826501fdb6a)
  • Exact-head inspection blocked: The PR head and base commits are known locally, but reading their trees required a promisor fetch that failed because github.com DNS resolution was unavailable. Exact source and diff verification could not be completed. (ac2585c983cd)
  • Dependency source unavailable: No installed CUA driver source/declarations were present in the checkout, so the claimed 0.19.3 session, generic-tool, and escalation semantics could not be independently checked. (extensions/cua-computer/package.json:5, e826501fdb6a)
  • Shared-contract provenance: Current-main history shows the provider seam and v2 contract were recently merged before this adapter work, making this an implementation layer rather than a duplicate change. (src/plugins/computer-use-contract.ts, d19c7553dd60)

Likely related people:

  • steipete: Current-main history attributes the merged v2 computer-use contract and provider-seam commits that define this adapter’s owner boundary to steipete. (role: introduced adjacent shared contracts; confidence: high; commits: 848a7e30b39f, d19c7553dd60; files: src/plugins/computer-use-contract.ts, extensions/cua-computer/src/commands.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-14T10:44:08.525Z sha ea61b62 :: found issues before merge. :: [P1] Restore the core-local wait action | [P1] Clear a failed desktop escalation before retrying

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 14, 2026
@steipete
steipete merged commit 2af5eca into main Aug 14, 2026
98 checks passed
@steipete
steipete deleted the steipete/cu-cua-v2-adapter branch August 14, 2026 10:59
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 14, 2026
steipete added a commit that referenced this pull request Aug 14, 2026
…r.act v2) (#123464)

* docs(plan): computer-use campaign plan — two-provider background computer use (CUA + Peekaboo) behind computer.act v2

* docs(plan): resolve W0-PIN — pinned 0.19.3 already contains inherited IPC and consent adapter

* docs(plan): W0 complete — parity fixtures landed (#123469)

* docs(plan): W1-SEAM landed (#123509)

* docs(plan): W1 complete — v2 contract landed (#123544)

* docs(plan): W2-CUA landed (#123604)

* docs(plan): W2-MAC landed (#123635)

* docs(plan): note picker screenshot evidence belongs to W2-UX

* docs(plan): avoid inline-html placeholder in tracker note
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…livery (openclaw#123604)

* feat(cua-computer): add full v2 adapter

* chore(cua-computer): drop release-owned changelog edit
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…r.act v2) (openclaw#123464)

* docs(plan): computer-use campaign plan — two-provider background computer use (CUA + Peekaboo) behind computer.act v2

* docs(plan): resolve W0-PIN — pinned 0.19.3 already contains inherited IPC and consent adapter

* docs(plan): W0 complete — parity fixtures landed (openclaw#123469)

* docs(plan): W1-SEAM landed (openclaw#123509)

* docs(plan): W1 complete — v2 contract landed (openclaw#123544)

* docs(plan): W2-CUA landed (openclaw#123604)

* docs(plan): W2-MAC landed (openclaw#123635)

* docs(plan): note picker screenshot evidence belongs to W2-UX

* docs(plan): avoid inline-html placeholder in tracker note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: cua-computer rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant