Skip to content

feat(computer-use): improve cua_repl AX, capture concurrency, element clicks, and progressive docs - #7505

Merged
M4n5ter merged 8 commits into
mainfrom
feat/cua-repl-ax-improvements
Dec 1, 2026
Merged

M4n5ter merged 8 commits into
mainfrom
feat/cua-repl-ax-improvements

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Dec 1, 2026

Copy link
Copy Markdown
Member

Summary

Improves cua_repl Agent Experience (AX) across macOS capture contention, AX-only observation overhead, unified indexed element clicking, secure-field input, timeout-safe sleeping, and progressive documentation delivery.

Changes

  1. Upstream maka-agent/cua:maka (018e70b3) & dependency bump

    • Upgraded NativeCaptureGate in platform-macos from fail-fast try_acquire() to a deadline-bounded Mutex + Condvar gate so healthy concurrent ScreenCaptureKit callers (e.g. Computer Stage preview + cua_repl frozen capture) wait cleanly instead of failing with ScreenCaptureKit capture already in flight or degrading preview into screencapture -l subprocesses. Stalled workers still fail fast and wake waiting callers via notify_all().
    • Bumped maka-agent/cua rev pins to 018e70b3 and regenerated reviewed third-party notices.
  2. Skip ScreenCaptureKit & ScreenRecording grant on macOS AX-only observations

    • Session::observe now sets capture_image = screenshot and skips tcc::require(Grant::ScreenRecording) and Driver::capture_prepared_window when kind == ObservationKind::Ax, while retaining prepare_page_frame for scroll(index) / moveCursor.
    • Updated system_permission::required so GetApp and Observe { App, kind: Ax } require only Accessibility.
  3. Unify macOS app.click(index) onto PendingClick

    • Generalized Slot::element_click_target and run_element_click in macos/controller.rs for both Window and Application slots and routed high-level Action::Click { target: Position::Element(_) } through PendingClick, deleting the duplicate action_inner click branch.
    • Preserved semantic AXShowMenu for single right-clicks when available, falling back to simulated events for controls without AXShowMenu and multi-clicks; removed the silent coercion of MouseButton::Middle to MouseButton::Left so middle-clicks dispatch via NativeClickButton::Other.
  4. Skip AXValue read-back verification on AXSecureTextField

    • Aligned macos.rs SetValue with upstream set_value.rs: when set_string_attr succeeds on AXSecureTextField, accept without plaintext read-back comparison.
  5. Add budget-checked cua.sleep(ms)

    • Exposed the existing op_maka_sleep op to the REPL bootstrap without acquiring Host device locks or suspending timeout.
    • Added CellTimeoutBudget::remaining_budget() and pre-checked sleep durations in op_maka_sleep so an over-budget wait rejects with a catchable JS error instead of terminating the REPL and wiping bindings.
  6. Progressive topic documentation emitted after observations (all 12 locales)

    • Unified all platform/computer-use/locales/docs/api.*.md markers to <!-- doc: name [aliases...] --> … <!-- /doc --> (rescuing the previously unreachable ### File choosers and uploads section into the files topic) and removed Command::Documentation in favor of Command::ReadDocumentation { name } with an auto-generated topic index appended to core.
    • Updated facade.js to emit observation values before deduplicated surface-scoped topics (core ~3.2 KB en / ~1.5 KB zh-CN, plus desktop or browser once per REPL epoch), cutting first-call doc output by ~75–90% and preventing observations from being pushed into archive:.

Verification

  • Upstream maka-agent/cua:maka (018e70b3): cargo test -p platform-macos --lib capture::tests (25/25) & capture::frozen::tests (3/3)
  • cargo test -p maka-computer-use --features native-desktop --lib (165/165)
  • cargo test -p maka-computer-use --features native-desktop --test integration (2/2, including observation-before-docs ordering assertion)
  • cargo test -p maka-js-runtime --test integration repl:: (13/13, including repl_sleep_checks_remaining_budget_without_terminating_the_repl)
  • cargo test -p maka-computer-native --lib (5/5) & cargo test -p maka-i18n-build (3/3)
  • cargo check -p maka-cli, cargo fmt --check, npx biome check, node scripts/i18n/check.mjs, node --test scripts/i18n/check.test.mjs, node scripts/rust/notices.mjs check-reviewed, node scripts/asf-license-headers.mjs check

@github-actions github-actions Bot added the effort/XXL Over 2500 readable lines label Dec 1, 2026

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reviewed 2f0bcf0e4a21a8a3b3e3b0abf97097490fc4058f. It merges cleanly with b7fb5b5d, and the required test check passed. The follow-up gives a capture its full execution timeout after it acquires the gate and restores the existing target and enabled-state checks before an indexed click.

Local checks passed for observation-before-documentation ordering, topic deduplication and retry, topic parity across all 12 locales, and JavaScript sleep input validation. I did not rerun the live macOS capture and input scenarios. The final dependency pin is 35762a79, which includes the capture timeout fix.


Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.

@M4n5ter
M4n5ter merged commit fd7f3ed into main Dec 1, 2026
3 checks passed
@M4n5ter
M4n5ter deleted the feat/cua-repl-ax-improvements branch December 1, 2026 16:31
jay23606 added a commit to jay23606/maka that referenced this pull request Dec 1, 2026
… clicks, and progressive docs (apache#7505)

* build(computer-use): bump cua rev to 018e70b3

* fix(computer-use): skip ScreenCaptureKit on macOS AX-only observe

* refactor(computer-use): unify macOS element clicks onto PendingClick

* fix(computer-use): skip AXValue read-back on AXSecureTextField

* feat(computer-use,js-runtime): add budget-checked cua.sleep(ms)

* feat(computer-use): emit progressive topic docs after observations

* fix(computer-use): address review findings on capture gate, element checks, and doc topics

* chore(computer-use): polish i18n catalog topic index, doc links, and cua test margins
jackwener added a commit that referenced this pull request Dec 2, 2026
A Read page that stops at a line end omits that newline and the next
page starts on the following line (facts/src/read/page.rs make_page:
next at stop.utf16 + 1). The browser stack fixture glued pages with
push_str, so after fd7f3ed (#7505) emitted trimmed doc topics before
the report, a page boundary landed on the report line and it was read
as "...best effort.{\"marker\":...}", failing check_report with 0
reports. Restore the newline when the next page's offset says one was
skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Generated-by: Claude Code (Claude Opus 5.5)
M4n5ter pushed a commit that referenced this pull request Dec 3, 2026
…ations (#7531)

Carry forward the CI repairs on Jack's branch and clean up follow-up regressions:\n\n- Fix the missing ACP ModelChoice.provider_id test fixture and format markdown-toc.test.mjs with Biome.\n- Update stale test expectations for NSH drag-lift selection events, desktop Google Gemini -> Antigravity connection flow, folded Bot turn layout settlement, archived Read page newlines, iOS Room recovery New Chat locator, and Agent replay/stack sizing.\n- Retain plaintext reasoning normalization policy on reused Responses wire prefixes via a shared wire::install helper.\n- Restore light-theme iOS pressed glass action contrast (#D9E8F2, 4.57:1) and narrow HostListNotices offline state from a single snapshot.\n- Keep macOS popup autofocus pending until first-frame show and resolve AppKit field editor ownership in keymap::editing.\n- Isolate Markdown TOC native list scroll state per turn inside TocHeadingList (covering docked, compact-pinned, and section lists) and drop the obsolete syncedTurn reuse branch.\n- Decode saved eval batch CellRecord outcomes via serde_json::Value so arbitrary_precision feature unification preserves numeric fields inside tagged enums.\n- Restore the resident-pressure model.has_wire_prefix() assertion in Agent driver wire prefix reuse tests.\n\nRefs #7443, #7488, #7395, #7499, #7503, #7504, #7505, #7456, #7515.\n\nCo-authored-by: jackwener <jakevingoo@gmail.com>\nCo-authored-by: M4n5ter <m4n5terrr@gmail.com>\nGenerated-by: Claude Code (Claude Opus 5.5)\nGenerated-by: Maka (OpenAI)\nGenerated-by: OpenAI Codex\nGenerated-by: Maka (Gemini 4 Neon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XXL Over 2500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants