Skip to content

chore(cua): upgrade driver to v0.17.0 - #2083

Merged
yyhhyyyyyy merged 3 commits into
devfrom
chore/cua-driver-0.17-upgrade
Aug 4, 2026
Merged

chore(cua): upgrade driver to v0.17.0#2083
yyhhyyyyyy merged 3 commits into
devfrom
chore/cua-driver-0.17-upgrade

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Upgrade the bundled CUA driver from v0.14.1 to v0.17.0 and the contract from v0.2.0 to v0.6.0.
  • Refresh upstream metadata, verified checksums, packaged catalogs, and explicit tool policies.
  • Integrate the five new tools: verify_state, set_window_frame, invoke_menu, clipboard_read, and clipboard_write.
  • Require snapshot-bound element targeting through element_token or element_index with snapshot_id.
  • Project the new ActionResult fields and include verify_state in the Computer Use verification loop.
  • Refresh the generated ACP agent registry.

MCP catalog compatibility

The CUA upgrade exposed a latent MCP v2 regression rather than an actual driver schema mismatch.

Live MCP schemas are normalized into null-prototype objects, while packaged catalogs previously used ordinary JavaScript objects. Node's prototype-sensitive deep comparison therefore rejected schemas containing identical JSON.

This PR:

  • applies the same bounded JSON Schema validation to live and packaged schemas;
  • compares schemas using JSON structural semantics;
  • ignores object prototypes and key insertion order;
  • preserves exact array order, keys, types, and values;
  • reports deterministic, bounded JSON Pointer diagnostics;
  • caches successful validation per client and tool;
  • invalidates cached validation when the registry or tool list changes;
  • continues to fail closed on genuine input-schema drift.

The existing compatibility behavior for malformed optional MCP outputSchema values remains unchanged.

Compatibility notes

  • Existing embedded daemon, MCP transport, signing, integrity, and serve --embedded flows are preserved.
  • All previous 49 tools remain available; five tools are added.
  • Bare element_index targeting is no longer accepted by CUA v0.17.0.
  • Action completion and task verification are now separate: action tools report ActionResult, while verify_state performs post-action verification.
  • Catalog and policy coverage remain closed and exact.

Summary by CodeRabbit

  • New Features

    • Upgraded Computer Use support to driver 0.17.0 with improved snapshot-based element targeting.
    • Added post-action verification, structured results, menu and window controls, and expanded permission policies.
    • Added bounded, clearer feedback for actions, verification states, refusals, and recovery guidance.
  • Bug Fixes

    • Improved tool catalog validation and detection of schema mismatches, including remote references.
    • Prevented misleading success guidance for failed or malformed actions.
  • Documentation

    • Updated Computer Use guidance, migration plans, specifications, and release validation records.
  • Tests

    • Expanded coverage for targeting, validation, permissions, structured results, and packaging compatibility.

@dosubot

dosubot Bot commented Aug 4, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-09-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about deepchat Add Dosu to your team

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The CUA integration is upgraded from driver 0.14.1 to 0.17.0 and contract 0.6.0. The change adds snapshot-bound targeting, bounded result projections, verification rules, updated policies, schema-drift validation, refreshed packaging metadata, and related documentation and tests.

Changes

CUA 0.17 contract migration

Layer / File(s) Summary
Contract, policy, and release specification
docs/architecture/..., docs/features/..., docs/architecture/plugin-external-runtime-lifecycle/..., plugins/cua/plugin.json, plugins/cua/policies/tool-policy.json, plugins/cua/vendor/cua-driver/upstream.json, scripts/package-plugin.mjs
The CUA contract, release pin, handshake versions, tool policies, packaging metadata, and acceptance criteria now target driver 0.17.0 and contract 0.6.0.
Snapshot addressing and result projections
src/main/plugin/cuaToolAdapter.ts, src/main/mcp/toolManager.ts
Snapshot-bound targets are validated. Window, ActionResult, verify_state, and refusal outputs use bounded projections. Error results skip successful-result projections.
Computer Use projection and recovery tests
plugins/cua/skills/computer-use/*, test/main/plugin/*, test/main/mcp/toolManager.test.ts, test/main/scripts/*
Skills and tests cover snapshot retries, verification states, malformed results, policy changes, error handling, release metadata, and generated catalogs.

Catalog schema validation

Layer / File(s) Summary
Structural schema comparison and catalog cloning
src/main/mcp/schemaValidation.ts, src/main/plugin/toolCatalog.ts, docs/issues/mcp-catalog-schema-representation-drift/spec.md, test/main/mcp/schemaValidation.test.ts, test/main/plugin/toolCatalog.test.ts
Catalog schemas use validated cloning and prototype-independent structural comparison with escaped JSON Pointer diagnostics.
Catalog validation cache and diagnostics
src/main/mcp/toolManager.ts, test/main/mcp/toolManager.test.ts
Catalog validation caches verified tools, reports exact schema differences, revalidates after invalidation, and prevents dispatch after schema drift.

ACP registry refresh

Layer / File(s) Summary
ACP package and archive metadata
resources/acp-registry/registry.json
Registry versions, package references, archive URLs, executable names, and checksums are refreshed for multiple ACP agents.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ComputerUseSkill
  participant CuaToolAdapter
  participant CuaDriver
  participant VerifyState
  ComputerUseSkill->>CuaToolAdapter: Submit snapshot-bound action
  CuaToolAdapter->>CuaDriver: Dispatch validated arguments
  CuaDriver-->>CuaToolAdapter: Return ActionResult
  CuaToolAdapter->>VerifyState: Request postcondition verification
  VerifyState-->>ComputerUseSkill: Return bounded verification result
Loading

Possibly related PRs

  • ThinkInAIXYZ/deepchat#2061: Both changes upgrade the bundled CUA driver and modify lifecycle specifications, adapter projections, and related tests.
  • ThinkInAIXYZ/deepchat#2055: Both changes update CUA driver metadata, policies, packaging, projection handling, and token validation.
  • ThinkInAIXYZ/deepchat#2052: This change builds on the same CUA lifecycle and adapter areas while advancing the runtime to 0.17.0.

Suggested reviewers: zerob13

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: upgrading the bundled CUA driver to version 0.17.0.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/cua-driver-0.17-upgrade

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
test/main/plugin/pluginService.test.ts (1)

2017-2024: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the clipboard policy, not only the tool name.

The migration contract in docs/architecture/cua-driver-0-17-contract-migration/spec.md Line 79 defines clipboard_read as deny. Line 2024 only checks that the identifier appears in combined. This passes when the skill mentions the tool but omits the denial and no-plaintext rule. Add an assertion for the exact maintained denial wording.

As per coding guidelines, “Keep committed tests lean and focused on project reliability, stability, and observable contracts” and “Add the smallest regression test for user-visible behavior or a documented contract.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/main/plugin/pluginService.test.ts` around lines 2017 - 2024, Update the
assertions in the test covering the combined CUA contract text so the
clipboard_read policy is verified, not just its identifier. Add an assertion for
the exact maintained wording that declares clipboard_read denied and prohibits
plaintext clipboard access, using the contract specification’s wording and
keeping the existing tool-name assertion.

Source: Coding guidelines

test/main/plugin/cuaToolAdapter.test.ts (1)

411-445: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add one case for an oversized observed_json.

The tests cover the predicate count bound and the missing observed_json key. They do not cover CUA_MAX_OBSERVED_JSON_CHARS. One case keeps that bound from regressing silently.

♻️ Proposed additional case
     expect(
       buildCuaVerifyStateProjection('verify_state', {
         ...base,
+        predicates: [{ ...base.predicates[0], observed_json: 'x'.repeat(2001) }]
+      })
+    ).toBe(undefined)
+    expect(
+      buildCuaVerifyStateProjection('verify_state', {
+        ...base,
         predicates: Array.from({ length: 9 }, (_, index) => ({
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/main/plugin/cuaToolAdapter.test.ts` around lines 411 - 445, Add a test
case in the rejects malformed or oversized verify_state output test that
supplies an observed_json value exceeding CUA_MAX_OBSERVED_JSON_CHARS and
asserts buildCuaVerifyStateProjection('verify_state', ...) returns undefined,
using the existing base predicate structure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/main/plugin/cuaToolAdapter.test.ts`:
- Around line 411-445: Add a test case in the rejects malformed or oversized
verify_state output test that supplies an observed_json value exceeding
CUA_MAX_OBSERVED_JSON_CHARS and asserts
buildCuaVerifyStateProjection('verify_state', ...) returns undefined, using the
existing base predicate structure.

In `@test/main/plugin/pluginService.test.ts`:
- Around line 2017-2024: Update the assertions in the test covering the combined
CUA contract text so the clipboard_read policy is verified, not just its
identifier. Add an assertion for the exact maintained wording that declares
clipboard_read denied and prohibits plaintext clipboard access, using the
contract specification’s wording and keeping the existing tool-name assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7fb93a53-435b-40ea-b5dc-57872caaa719

📥 Commits

Reviewing files that changed from the base of the PR and between 7a4b1ed and 7b50b1c.

📒 Files selected for processing (28)
  • docs/architecture/cua-driver-0-17-contract-migration/plan.md
  • docs/architecture/cua-driver-0-17-contract-migration/spec.md
  • docs/architecture/cua-driver-0-17-contract-migration/tasks.md
  • docs/architecture/plugin-external-runtime-lifecycle/plan.md
  • docs/architecture/plugin-external-runtime-lifecycle/spec.md
  • docs/architecture/plugin-external-runtime-lifecycle/tasks.md
  • docs/features/cua-cross-platform-computer-use/spec.md
  • docs/issues/mcp-catalog-schema-representation-drift/spec.md
  • plugins/cua/plugin.json
  • plugins/cua/policies/tool-policy.json
  • plugins/cua/skills/computer-use/README.md
  • plugins/cua/skills/computer-use/SKILL.md
  • plugins/cua/skills/computer-use/TESTS.md
  • plugins/cua/vendor/cua-driver/upstream.json
  • resources/acp-registry/registry.json
  • scripts/package-plugin.mjs
  • src/main/mcp/schemaValidation.ts
  • src/main/mcp/toolManager.ts
  • src/main/plugin/cuaToolAdapter.ts
  • src/main/plugin/toolCatalog.ts
  • test/main/mcp/schemaValidation.test.ts
  • test/main/mcp/toolManager.test.ts
  • test/main/plugin/cuaEmbeddedAdapter.test.ts
  • test/main/plugin/cuaToolAdapter.test.ts
  • test/main/plugin/pluginService.test.ts
  • test/main/plugin/toolCatalog.test.ts
  • test/main/scripts/buildCuaPluginRuntime.test.ts
  • test/main/scripts/packagePlugin.test.ts

@yyhhyyyyyy
yyhhyyyyyy merged commit fed2c65 into dev Aug 4, 2026
15 checks passed
@yyhhyyyyyy
yyhhyyyyyy deleted the chore/cua-driver-0.17-upgrade branch August 4, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant