chore(cua): upgrade driver to v0.17.0 - #2083
Conversation
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
📝 WalkthroughWalkthroughThe 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. ChangesCUA 0.17 contract migration
Catalog schema validation
ACP registry refresh
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
test/main/plugin/pluginService.test.ts (1)
2017-2024: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the clipboard policy, not only the tool name.
The migration contract in
docs/architecture/cua-driver-0-17-contract-migration/spec.mdLine 79 definesclipboard_readasdeny. Line 2024 only checks that the identifier appears incombined. 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 valueAdd one case for an oversized
observed_json.The tests cover the predicate count bound and the missing
observed_jsonkey. They do not coverCUA_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
📒 Files selected for processing (28)
docs/architecture/cua-driver-0-17-contract-migration/plan.mddocs/architecture/cua-driver-0-17-contract-migration/spec.mddocs/architecture/cua-driver-0-17-contract-migration/tasks.mddocs/architecture/plugin-external-runtime-lifecycle/plan.mddocs/architecture/plugin-external-runtime-lifecycle/spec.mddocs/architecture/plugin-external-runtime-lifecycle/tasks.mddocs/features/cua-cross-platform-computer-use/spec.mddocs/issues/mcp-catalog-schema-representation-drift/spec.mdplugins/cua/plugin.jsonplugins/cua/policies/tool-policy.jsonplugins/cua/skills/computer-use/README.mdplugins/cua/skills/computer-use/SKILL.mdplugins/cua/skills/computer-use/TESTS.mdplugins/cua/vendor/cua-driver/upstream.jsonresources/acp-registry/registry.jsonscripts/package-plugin.mjssrc/main/mcp/schemaValidation.tssrc/main/mcp/toolManager.tssrc/main/plugin/cuaToolAdapter.tssrc/main/plugin/toolCatalog.tstest/main/mcp/schemaValidation.test.tstest/main/mcp/toolManager.test.tstest/main/plugin/cuaEmbeddedAdapter.test.tstest/main/plugin/cuaToolAdapter.test.tstest/main/plugin/pluginService.test.tstest/main/plugin/toolCatalog.test.tstest/main/scripts/buildCuaPluginRuntime.test.tstest/main/scripts/packagePlugin.test.ts
Summary
verify_state,set_window_frame,invoke_menu,clipboard_read, andclipboard_write.element_tokenorelement_indexwithsnapshot_id.ActionResultfields and includeverify_statein the Computer Use verification loop.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:
The existing compatibility behavior for malformed optional MCP
outputSchemavalues remains unchanged.Compatibility notes
serve --embeddedflows are preserved.element_indextargeting is no longer accepted by CUA v0.17.0.ActionResult, whileverify_stateperforms post-action verification.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests