Skip to content

feat(computer-use): computer.act v2 action contract with capability-filtered tool - #123544

Merged
steipete merged 5 commits into
mainfrom
steipete/cu-v2-contract
Aug 14, 2026
Merged

steipete merged 5 commits into
mainfrom
steipete/cu-v2-contract

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The computer.act contract exposes only 13 desktop-coordinate actions, so none of the background window-scoped capabilities both providers (CUA Driver, Peekaboo) now support can reach the model. Campaign: docs/plan/computer-use.md (#123464); builds on the parity fixtures (#123469) and the provider seam (#123509).

Why This Change Was Made

Promotes the frozen 40-action v2 union to its owner (src/plugins/computer-use-contract.ts, re-exported via openclaw/plugin-sdk/computer-use), adds discriminated action variants for discovery, window observation (opaque windowRef/elementRef/observationId), app lifecycle, set_value/invoke_menu/zoom, per-action deliveryMode, escalate_scope, a result envelope (effect/observation/escalation, hard-capped), and an additive per-node capability descriptor. The built-in computer tool filters its schema to exactly what the selected node advertises; nodes without a descriptor get today's v1 coordinate family — capability honesty, not a compat lane. The 13 existing wire actions keep byte-identical field encoding, so no Swift changes are needed this wave. Browser/recording families are capability-gated contract members that land with their adapters (W4).

User Impact

No behavior change for current nodes: same actions, same wire encoding, same arming/pairing. New v2 actions become reachable only when a node advertises them (W2 adapters). Tool schema token cost: v1-only node 651 tokens, full v2 descriptor 742 tokens (o200k_base) — well under the 1K budget threshold.

Evidence

  • Focused suites green: 2,010 passed / 1 skipped (worker run); post-fix rerun of contract + plugin suites: 5 files, 54 tests green; pnpm check:test-types exit 0.
  • pnpm plugin-sdk:surface:check green (+6 non-callable exports, documented budget increments).
  • git diff --check clean; LOC: production/tooling +915/−159, tests/fixtures +409/−52.
  • No protocol version bump; descriptor rides the existing node declaration as one additive optional field through the normal pairing-upgrade path.

@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 07:25
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling plugin: cua-computer size: XL maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added 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. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 14, 2026, 5:23 AM ET / 09:23 UTC.

ClawSweeper review

What this changes

The PR adds a version-two Computer Use action contract, node capability descriptors, and a computer tool intended to expose only actions supported by the selected node.

Merge readiness

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

Keep this protected maintainer PR open: the current head still has four prior action-boundary blockers, including unapproved capability widening and unbounded model-visible output.

Priority: P1
Reviewed head: fef3208e34e5cd9dc4cd66983b9bb01322644730

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The branch has high-confidence action-authority and model-context defects that block merge.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported focused tests still do not address the blocking source defects.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported focused tests still do not address the blocking source defects.
Evidence reviewed 8 items Unbounded model output: The result schema permits 64 arbitrary detail values and the tool serializes the parsed result verbatim, allowing long or nested values to exhaust model context.
Descriptor bypasses pairing approval: Reconnect logic detects only command, cap, and permission upgrades, then makes the declared Computer Use descriptor effective when the existing command pair remains approved.
Schema is resolved too late: The tool starts from the v1 actions when no descriptor is supplied, then replaces its schema only during execute; the normal factory call supplies no descriptor.
Findings 4 actionable findings [P0] Bound every model-visible result field
[P1] Gate descriptor widening through pairing
[P1] Resolve capabilities before publishing the tool schema
Security Needs attention Descriptor actions bypass pairing approval: A reconnect with unchanged commands but a wider descriptor is treated as effective, allowing new dangerous action types to be advertised without user reapproval.

How this fits together

Computer Use routes model tool calls through the Gateway to a paired node-host provider. The provider declares capabilities, the Gateway reconciles them with pairing, and the agent tool exposes actions to the model.

flowchart LR
  A[Node-host provider] --> B[Capability descriptor]
  B --> C[Gateway pairing reconciliation]
  C --> D[Live node session]
  D --> E[Computer tool schema]
  E --> F[Model action]
  F --> G[Paired node command]
Loading

Before merge

  • Bound every model-visible result field (P0) - details accepts arbitrary nested values and computerActResultText serializes it verbatim, so one valid provider response can exhaust model context. This repeats the prior P0 blocker; project strings, depth, collection size, and total output before rendering.
  • Gate descriptor widening through pairing (P1) - The reconnect comparison ignores the descriptor; a node whose command pair was already approved can add background or application-control actions and have them published immediately. Store and compare the approved descriptor, or require re-pairing before exposing widened actions.
  • Resolve capabilities before publishing the tool schema (P1) - The normal factory call supplies no descriptor, so this falls back to v1 actions. Replacing the schema during execution is after the model has selected an action; resolve the node descriptor before tool definitions are built.
  • Register invoke policy through the shared provider helper (P1) - The helper advertises a canonical command pair but cannot register the dangerous invoke policy; the CUA plugin must duplicate it, and a second provider will fail closed if it omits that separate step. Keep this policy beside command registration.
  • Resolve security concern: Descriptor actions bypass pairing approval - A reconnect with unchanged commands but a wider descriptor is treated as effective, allowing new dangerous action types to be advertised without user reapproval.
  • Resolve merge risk (P1) - A paired node can widen from coordinate input to background or application-control actions without new pairing approval.
  • Resolve merge risk (P1) - The model initially receives only v1 actions, so the advertised v2 capability is not reachable in the normal tool-definition flow.
  • Resolve merge risk (P1) - A valid provider result can exhaust model context through nested details and long strings.
  • Resolve merge risk (P1) - The asserted Codex schema compatibility remains unverified because ../codex is absent in this read-only environment.
  • Complete next step (P2) - This maintainer-authored, protected PR needs a coherent repair across its SDK, pairing, and tool-publication boundaries before merge.
  • Improve patch quality - Repair the four blocking paths and add regressions for descriptor widening, pre-publication schema filtering, output bounds, and shared invoke-policy registration.
  • Improve patch quality - Add a redacted paired-node trace showing the approved filtered action set and a bounded provider-result projection.

Findings

  • [P0] Bound every model-visible result field — src/agents/tools/computer-tool.ts:546
  • [P1] Gate descriptor widening through pairing — src/gateway/node-connect-reconcile.ts:258
  • [P1] Resolve capabilities before publishing the tool schema — src/agents/tools/computer-tool.ts:821-823
  • [high] Descriptor actions bypass pairing approval — src/gateway/node-connect-reconcile.ts:258
Agent review details

Security

Needs attention: The patch can expose newly declared dangerous desktop actions without a durable pairing approval for that descriptor.

PR surface

Source +731, Tests +406, Other +5. Total +1142 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 21 948 217 +731
Tests 10 421 15 +406
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 6 1 +5
Total 33 1375 233 +1142

Review metrics

Metric Value Why it matters
Production versus test delta production/tooling +915/-159; tests/fixtures +409/-52 This feature grows a public plugin contract and model-to-node authority path, so boundary behavior needs stronger end-to-end proof.

Stored data model

Persistent data-model change detected: serialized state: src/node-host/runtime.ts, serialized state: src/plugins/computer-use-contract.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Repair authority and result boundaries (recommended)
    Require re-pairing for descriptor widening, prepare the filtered schema before model tool publication, bound serialized results, and centralize invoke-policy registration.
  2. Pause the v2 rollout
    Retain the existing coordinate contract until descriptor approval and pre-publication resolution have one coherent owner-boundary design.

Technical review

Best possible solution:

Make the descriptor a durable pairing-approved authority surface, resolve it before publishing the model tool, bound every serialized result field, and register dangerous invoke policy through the canonical provider helper.

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

Yes from source: an already paired node can reconnect with unchanged commands and a wider descriptor, while a valid 64-key arbitrary details record reaches JSON serialization unchanged.

Is this the best way to solve the issue?

No. The patch updates runtime state after tool publication, does not make descriptor widening an approved authority change, and leaves model-visible result fields unbounded.

Full review comments:

  • [P0] Bound every model-visible result field — src/agents/tools/computer-tool.ts:546
    details accepts arbitrary nested values and computerActResultText serializes it verbatim, so one valid provider response can exhaust model context. This repeats the prior P0 blocker; project strings, depth, collection size, and total output before rendering.
    Confidence: 0.99
  • [P1] Gate descriptor widening through pairing — src/gateway/node-connect-reconcile.ts:258
    The reconnect comparison ignores the descriptor; a node whose command pair was already approved can add background or application-control actions and have them published immediately. Store and compare the approved descriptor, or require re-pairing before exposing widened actions.
    Confidence: 0.98
  • [P1] Resolve capabilities before publishing the tool schema — src/agents/tools/computer-tool.ts:821-823
    The normal factory call supplies no descriptor, so this falls back to v1 actions. Replacing the schema during execution is after the model has selected an action; resolve the node descriptor before tool definitions are built.
    Confidence: 0.98
  • [P1] Register invoke policy through the shared provider helper — src/plugins/computer-use-contract.ts:459-460
    The helper advertises a canonical command pair but cannot register the dangerous invoke policy; the CUA plugin must duplicate it, and a second provider will fail closed if it omits that separate step. Keep this policy beside command registration.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: The proposed Computer Use expansion can expose unapproved actions or leave advertised actions unavailable to the model.
  • merge-risk: 🚨 compatibility: The public plugin SDK and node declaration gain capability behavior that current pairing state does not represent.
  • merge-risk: 🚨 security-boundary: A node can widen dangerous Computer Use actions without a corresponding durable pairing approval.
  • merge-risk: 🚨 availability: Unbounded provider-result serialization can exhaust the model context during normal use.
  • 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: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported focused tests still do not address the blocking source defects.

Evidence

Security concerns:

  • [high] Descriptor actions bypass pairing approval — src/gateway/node-connect-reconcile.ts:258
    A reconnect with unchanged commands but a wider descriptor is treated as effective, allowing new dangerous action types to be advertised without user reapproval.
    Confidence: 0.98

What I checked:

Likely related people:

  • steipete: The supplied history credits this person with the merged provider seam and the proposed v2 contract path. (role: recent Computer Use contributor; confidence: medium; commits: 848a7e30b39f, fef3208e34e5; files: src/plugins/computer-use-contract.ts, src/agents/tools/computer-tool.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 (4 earlier review cycles)
  • reviewed 2026-08-14T07:31:52.688Z sha 4c4c193 :: needs real behavior proof before merge. :: [P1] Gate descriptor widening through node pairing | [P1] Resolve node capabilities before publishing the tool schema | [P1] Advertise only CUA actions that can execute
  • reviewed 2026-08-14T08:23:21.566Z sha a71e6f0 :: found issues before merge. :: [P0] Bound model-visible Computer Use results | [P1] Resolve node capability before publishing tool schema | [P1] Advertise only CUA actions that can execute | [P1] Require re-pairing for descriptor widening | [P1] Keep the invoke policy in the provider helper
  • reviewed 2026-08-14T08:37:51.780Z sha c0b1b0e :: found issues before merge. :: [P0] Bound every model-visible result field | [P1] Preserve the shipped provider contract | [P1] Resolve node capabilities before building the schema | [P1] Hide contract-only actions from the schema | [P1] Gate descriptor widening through pairing | [P1] Restore descriptors during in-place approval
  • reviewed 2026-08-14T09:13:04.462Z sha 3ddcf04 :: found issues before merge. :: [P0] Bound every model-visible result field | [P1] Gate descriptor widening through pairing | [P1] Resolve capabilities before publishing the tool schema | [P1] Advertise only actions CUA can execute | [P1] Keep invoke policy in the shared provider helper

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed P1 High-priority user-facing bug, regression, or broken workflow. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. labels Aug 14, 2026
@steipete
steipete merged commit d19c755 into main Aug 14, 2026
172 checks passed
@steipete
steipete deleted the steipete/cu-v2-contract branch August 14, 2026 09:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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
…iltered tool (openclaw#123544)

* feat(computer-use): computer.act v2 action contract with capability-filtered tool

* fix(computer-use): break contract import cycle, bound model-visible elements, regen swift protocol

* test(computer-use): satisfy curly rule in schema-cap helpers

* fix(computer-use): satisfy type-aware lint on contract and tool

* test(gateway-protocol): keep connect-params suite under the line cap
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

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime 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. P1 High-priority user-facing bug, regression, or broken workflow. plugin: cua-computer rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts 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