Skip to content

chore(cua): upgrade driver to v0.13.1 - #2055

Merged
zerob13 merged 3 commits into
devfrom
chore/cua-driver-v0.13.1
Jul 29, 2026
Merged

chore(cua): upgrade driver to v0.13.1#2055
zerob13 merged 3 commits into
devfrom
chore/cua-driver-v0.13.1

Conversation

@yyhhyyyyyy

@yyhhyyyyyy yyhhyyyyyy commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Upgrade the bundled CUA driver from v0.12.6 to v0.13.1 across macOS, Windows, and Linux, and align DeepChat with the updated native tool contracts.

Changes

  • Pin the v0.13.1 upstream commit, release artifacts, and SHA256 checksums.
  • Update the packaged driver version and platform-specific tool catalogs.
  • Replace set_agent_cursor_style with set_agent_cursor_theme.
  • Update the complete cursor contract:
    • require session for cursor state, motion, and theme operations;
    • remove unsupported cursor appearance fields;
    • align get_agent_cursor_state with the new response shape.
  • Add browser_type.replace support, including empty-text field clearing.
  • Remove the obsolete Windows UIA worker environment configuration.
  • Exclude the macOS cua-cursor-theme authoring sidecar and fail closed unless Contents/MacOS contains only deepchat-cua-driver.
  • Keep normal start_session calls free of cursor_theme; explicit appearance changes use set_agent_cursor_theme.
  • Normalize empty optional element_token values without changing valid indices, coordinates, or unrelated falsy arguments.
  • Preserve raw MCP structuredContent while projecting bounded refusal.code values into model-visible content.
  • Recover from stale_element_token, generation_mismatch, and invalid_element_token by taking one fresh snapshot and retrying with its replacement token.
  • Remove policy-bypass guidance and document cooperative application shutdown and the read-only legacy page contract.
  • Add regression coverage for configuration drift, real refusal wire shapes, token recovery guidance, cursor contracts, and macOS runtime closure.

Known v0.13.1 limitation

launch_app and kill_app use per-session ownership internally, but their public schemas omit the session field. As a result, a schema-conforming owned-process termination cannot succeed in standard mode.

DeepChat therefore:

  • denies kill_app;
  • uses cooperative application close flows;
  • does not inject undeclared arguments or bypass product policy.

This should be revisited after upstream exposes session in the affected schemas.

Summary by CodeRabbit

  • New Features
    • Upgraded Computer Use support to driver version 0.13.1.
    • Enhanced model output formatting for structured refusal codes and token grounding.
    • Added cursor theme workflow and refined browser text replacement (browser_type replace behavior) including screenshot inclusion gating.
  • Bug Fixes
    • Restricted app termination attempts (kill_app) for the 0.13.1 tool contract.
    • Tightened stale/invalid element token retry rules to require fresh state.
    • Improved macOS packaging validation to exclude an upstream cursor-theme helper binary.
  • Documentation
    • Updated architecture specs, tasks, and Computer Use workflow/safety/test guidance, plus verification records.

@dosubot

dosubot Bot commented Jul 29, 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-08-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 Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8624a3d1-a82d-404c-9168-13fe601a5354

📥 Commits

Reviewing files that changed from the base of the PR and between b3fba00 and b2c95ea.

📒 Files selected for processing (1)
  • docs/architecture/plugin-external-runtime-lifecycle/plan.md

📝 Walkthrough

Walkthrough

The PR upgrades the bundled CUA driver from 0.12.6 to 0.13.1, updates policies and packaging, adds bounded refusal-code projections, revises token and cursor-theme guidance, removes the UIA-worker override, excludes the macOS theme sidecar, and refreshes validation coverage.

Changes

CUA 0.13.1 upgrade

Layer / File(s) Summary
Contract and release-gate updates
docs/architecture/..., docs/features/...
Specifications and task plans now describe the 0.13.1 contract, token retry rules, refusal projections, policy changes, packaging requirements, and remaining native release gates.
Runtime pinning and packaging
plugins/cua/..., scripts/..., plugins/cua/vendor/...
Runtime metadata, checksums, tool policies, environment validation, and macOS helper staging align with 0.13.1; the theme-authoring sidecar is removed and unexpected executables are rejected.
Model-facing adapter projections
src/main/plugin/cuaToolAdapter.ts, src/main/mcp/toolManager.ts
CUA results preserve structured content while appending window-state and validated refusal-code projections.
Computer-use guidance
plugins/cua/skills/computer-use/*
Skill documentation specifies fresh-token retries, cursor-theme usage, browser replacement semantics, screenshot constraints, and cooperative app closing.
Validation coverage
test/main/..., test/renderer/...
Tests update version fixtures and verify refusal projections, token formats, policies, environment restrictions, catalog generation, integrity checks, packaging, and macOS staging closure.

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

Sequence Diagram(s)

sequenceDiagram
  participant CUA Driver
  participant ToolManager
  participant cuaToolAdapter
  participant DeepChat Model
  CUA Driver->>ToolManager: return structuredContent
  ToolManager->>cuaToolAdapter: provide tool name and result
  cuaToolAdapter->>cuaToolAdapter: validate refusal.code
  cuaToolAdapter->>DeepChat Model: append snapshot and bounded refusal projections
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 matches the main change: upgrading the bundled CUA driver to v0.13.1.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/cua-driver-v0.13.1

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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@docs/architecture/plugin-external-runtime-lifecycle/plan.md`:
- Around line 114-116: Resolve the conflicting driver versions in the plan by
updating the earlier pin requirement in Section 7 to cua-driver-rs-v0.13.1, or
explicitly marking it as historical foundation work if that version must remain.
Ensure the document has one unambiguous current target consistent with Section
11.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 77999e7f-77d4-4256-8207-9c8a5e11f0ce

📥 Commits

Reviewing files that changed from the base of the PR and between 0bb2cc9 and b3fba00.

📒 Files selected for processing (29)
  • 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/features/cua-cross-platform-computer-use/tasks.md
  • plugins/cua/mcp/cua-driver.json
  • 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/skills/computer-use/WEB_APPS.md
  • plugins/cua/vendor/cua-driver/upstream.json
  • scripts/build-cua-plugin-runtime.mjs
  • scripts/package-plugin.mjs
  • src/main/mcp/toolManager.ts
  • src/main/plugin/cuaEmbeddedAdapter.ts
  • src/main/plugin/cuaToolAdapter.ts
  • test/main/agent/deepchat/runtime/toolAdapters.test.ts
  • test/main/mcp/toolManager.test.ts
  • test/main/plugin/cuaEmbeddedAdapter.test.ts
  • test/main/plugin/cuaRuntimeIntegrity.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
  • test/renderer/plugins/cuaSettings.test.ts
  • test/renderer/stores/mcpStore.test.ts
💤 Files with no reviewable changes (3)
  • plugins/cua/mcp/cua-driver.json
  • src/main/plugin/cuaEmbeddedAdapter.ts
  • test/renderer/stores/mcpStore.test.ts

Comment thread docs/architecture/plugin-external-runtime-lifecycle/plan.md
@zerob13
zerob13 merged commit a62d45a into dev Jul 29, 2026
21 checks passed
@zhangmo8
zhangmo8 deleted the chore/cua-driver-v0.13.1 branch July 29, 2026 06:07
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.

2 participants