feat(cua-driver): sync vendored cua-driver 0.6.8 → 0.7.0 - #6212
Conversation
Upstream 0.7.0 brings action-time modality (get_window_state always returns AX tree + screenshot, capture_mode retired), honest verification (every action returns verified/path/effect/escalation), browser page (CDP) tools, desktop-scope (capture_scope=window|desktop, get_desktop_state, screen-absolute click/scroll), and Rust-only consolidation (Swift backend retired). Cherry-pick patch changes: - #2025 (X11 synthetic click): retired — superseded by 0.7.0 honest-verification - #2035 (session revive): retired — superseded by 0.7.0 revive_session/loud-reject/is_session_lifecycle_tool - #2036 (EAGAIN socket write retry): re-injected — merged upstream post-0.7.0 tag, EAGAIN os error 35 is not acceptable - #2021 (null/empty-title windows + resolve_uwp_host_window): retained, adapted to 0.7.0's new is_listable_top_level and window_title helpers Shim extensions: - coord_norm: desktop-scope support — denormalize_args falls back to screen basis when no window cache (desktop-scope click), normalize_result handles get_desktop_state, ingest_screen_size reads get_desktop_state's screen_width/height - serve.rs: rewrite_coord_desc re-injected at both tools/list sites Install scripts simplified to Rust-only (Swift backend retired upstream). Fix platform-linux cross-compilation: cfg-gate wayland::PORTAL_LIBEI_ENABLED reference in health_report.rs for non-linux hosts.
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Hey @LaZzyMan, thanks for the PR — syncing vendored dependencies is important work.
The PR body doesn't follow the PR template. The current body uses ## Summary and ## Test plan, but the template requires these specific sections:
- What this PR does — describe the change in prose
- Why it's needed — motivation and user-facing benefit
- Reviewer Test Plan — with "How to verify", "Evidence (Before & After)", "Tested on", and "Environment" subsections
- Risk & Scope — main risk, what's out of scope, breaking changes
- Linked Issues
This isn't just formatting — the template helps reviewers (and future maintainers) quickly understand the why and how to verify, which is especially important for a 332-file vendor sync.
Could you update the PR body to follow the template? The content you already have is good — it mostly needs to be reorganized under the right headings.
中文说明
感谢 PR!同步 vendored 依赖是很重要的工作。
PR 正文没有按照 PR 模板 填写。当前使用了 ## Summary 和 ## Test plan,但模板要求以下章节:
- What this PR does — 用文字描述变更内容
- Why it's needed — 动机和用户侧收益
- Reviewer Test Plan — 包含"How to verify"、"Evidence (Before & After)"、"Tested on"和"Environment"子章节
- Risk & Scope — 主要风险、不在范围内的内容、破坏性变更
- Linked Issues
这不仅是格式问题——模板帮助审查者(和未来的维护者)快速理解 为什么 和 如何验证,对于 332 个文件的 vendor 同步尤为重要。
请按模板重新组织 PR 正文,现有内容质量不错,主要是需要放到正确的章节下。
— Qwen Code · qwen3.7-max
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
wenshao
left a comment
There was a problem hiding this comment.
[Suggestion] uninstall.sh:530+ — 220+ lines of unreachable Swift uninstall code. USE_RUST_BACKEND=1 is hardcoded and the Rust branch ends with exit 0 at line 530. Everything after is dead code. The USE_RUST_BACKEND variable itself is a dead flag. Delete lines 535-754 and remove the variable.
— qwen3.7-max via Qwen Code /review
…denormalize_args When screenshot_w == 0 (no cached window size), check whether the call has a pid/window_id target before falling back to screen-size basis. Window-scoped clicks with a cache miss now correctly leave coordinates as-is instead of mapping them against the screen dimensions.
Review round 1 summaryThis is an upstream sync PR (0.6.8 → 0.7.0). Our modifications are limited to: serve.rs shim re-injection (#2036 EAGAIN retry + rewrite_coord_desc), coord_norm.rs desktop-scope extension, windows.rs #2021 re-application, install script simplification, and a platform-linux cross-compilation fix. All other files are upstream 0.7.0 verbatim (shasum-verified).
|
…-scope coord basis ingest_screen_size was reading screen_width/height (logical display points from CGDisplayBounds) for get_desktop_state, but the model operates on the screenshot PNG whose dimensions are physical pixels. On Retina displays (2x) this caused every desktop-scope click to land at half the intended position. Read screenshot_width/height instead — the same basis normalize_result rewrites to 1000. Updated test to use realistic Retina values (screen 1920, screenshot 3840) to catch 1:1 masking.
…ysical (desktop-scope) The single screen_cache was being written by both get_screen_size (logical points, e.g. 1920x1080) and get_desktop_state (physical pixels, e.g. 3840x2160). Since move_cursor operates in CGEvent screen points (logical) while desktop-scope clicks operate in screenshot pixels (physical), whichever tool ran last would corrupt the other's denormalization basis — causing 2x overshoot or 1/2 offset on Retina. Split into: - SCREEN_SIZE: logical points, written by get_screen_size, consumed by move_cursor (screen_basis=true) - DESKTOP_SCREENSHOT_SIZE: physical pixels, written by get_desktop_state, consumed by desktop-scope click fallback (screenshot_w==0, no pid) Added cross-contamination isolation tests.
wenshao
left a comment
There was a problem hiding this comment.
The incremental change since the last review (cache split in coord_norm.rs) correctly addresses both Critical findings about coordinate space pollution on Retina displays. The two caches are properly separated — SCREEN_SIZE (logical points for move_cursor) and DESKTOP_SCREENSHOT_SIZE (physical pixels for desktop-scope clicks) — with well-structured tests covering the key behavioral invariants. Build and all 149 tests pass.
— qwen3.7-max via Qwen Code /review
Summary
Sync the vendored
packages/cua-driver/from upstreamcua-driver-rs-v0.6.8tocua-driver-rs-v0.7.0.Upstream 0.7.0 highlights
get_window_statealways returns AX tree + screenshot;capture_moderetiredverified/path/effect/escalation(no more false successes)capture_scope=window|desktop,get_desktop_state(full-display, no downscale), screen-absoluteclick/scrollCherry-pick patch disposition
revive_session/loud-rejectos error 35is not acceptableis_listable_top_level/window_titlehelpersOur shim extensions
denormalize_argsfalls back to screen basis for desktop-scope clicks (no pid),normalize_resulthandlesget_desktop_state,ingest_screen_sizereadsget_desktop_state'sscreen_width/heightrewrite_coord_descre-injected at both daemon tools/list response sitesBuild fix
platform-linux/health_report.rs: cfg-gatewayland::PORTAL_LIBEI_ENABLEDreference for non-linux cross-compilationTest plan
cargo check— all crates pass (0 errors)cargo test -p cua-driver-core— 143 tests pass (including 3 new desktop-scope coord_norm tests)find packages/cua-driver -name '*.rej'— empty (all conflicts resolved)write_all_with_retryin serve.rs (1 occurrence),rewrite_coord_descin serve.rs (2 occurrences)