Repository navigation
feat(cua-computer): full v2 adapter with background window/element delivery - #123604
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 6:53 AM ET / 10:53 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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
Before merge
Findings
Agent review detailsSecurityNeeds 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 surfaceSource +1176, Tests +433. Total +1609 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…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
…livery (openclaw#123604) * feat(cua-computer): add full v2 adapter * chore(cua-computer): drop release-owned changelog edit
…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
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
createConfiguredauthorization ceiling.Capability descriptor
left_mouse_down/left_mouse_up)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-driver0.19.3 declarations used directly:cua_driver_sdk.d.ts:10,23-55,317-355— immutable trusted-session factory/options andToolResultstructured/action envelopes.cua_driver_sdk.d.ts:2014-2069,2304-2375— genericcallTool, session lifecycle/escalation, typed desktop tools, and explicitclose.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.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>andgit 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
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.tsis net -10 lines and retains only the byte-compatible desktop path plus provider assembly.