Skip to content

fix(cua-driver): bound large macOS text synthesis - #2863

Merged
f-trycua merged 2 commits into
mainfrom
codex/fix-large-type-text-2861
Aug 4, 2026
Merged

fix(cua-driver): bound large macOS text synthesis#2863
f-trycua merged 2 commits into
mainfrom
codex/fix-large-type-text-2861

Conversation

@f-trycua

@f-trycua f-trycua commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep large atomic macOS AX text insertion uncapped
  • estimate the actual Unicode or physical synthesis route before posting character events
  • refuse over-budget synthesis before mutation with structured chunk or verify-state guidance
  • report observable partial AX delivery without appending the full payload again
  • refresh the generated MCP reference with the bounded-delivery contract

Why

The macOS synthesized fallback has a per-character floor plus a bounded delivery drain. Large payloads can therefore outlive the daemon's 120-second request deadline, leaving callers with a transport timeout while the target may still be partially mutating.

This change gives synthesized routes a documented 100-second scheduled-work budget, reserving the remaining transport time for event construction, routing, focus assistance, queueing, response serialization, and transport delivery. Atomic AX insertion remains the preferred one-call path and is deliberately exempt because its cost does not scale per character.

Fixes #2861

Regression coverage

  • exact transport-budget boundary and one-character-over refusal
  • large atomic AX payload remains uncapped
  • terminal and foreground routes refuse before invalid target/event work
  • structured safe-chunk versus indeterminate-AX diagnostics
  • partial AX progress returns the delivered prefix instead of replaying the complete payload
  • web AX ambiguity requires state verification rather than blind retry

Verification

Exact source: 358bd55dd1dde03df1aab246d8b7d72a169e9f8a

  • cargo test -p platform-macos — 312 passed, 0 failed; 1 doctest ignored
  • focused type_text tests — 19 passed, 0 failed
  • cargo fmt --all -- --check
  • git diff --check origin/main...HEAD
  • npx tsx scripts/docs-generators/runner.ts --library cua-driver --check
  • generated contract/SDK parity passed on macOS, Linux, and Windows in CI

Native macOS certification

Certified from the exact source SHA on a disposable macOS 26.5.2 arm64 Lume guest using a signed Cua Driver 0.17.0 candidate.

  • installed binary SHA-256: 5a4b0aea4a3cf971677631f7ac17767064afa65e14ded178facd746e289423d7
  • designated requirement leaf: d78483e2cab099da4b14bed941d479b902fee005
  • get_config.source_sha matched the exact PR head
  • the driver reported Accessibility and Screen Recording granted under its own responsible app identity
  • a 3,000-character foreground Electron request at 30ms/character returned type_text_synthesis_budget_exceeded in 1.1 seconds with delivered_chars: 0, synthesized_chars: 0, and a safe chunk limit of 2,578 characters
  • a fresh accessibility snapshot proved the real Electron field remained exactly type here after refusal
  • a subsequent 17-character foreground request reported all 17 delivered and the real field contained the marker, proving the daemon and normal route remained responsive
  • the reporter's smaller-payload concern was also exercised: 300 synthesized characters at 0ms completed in 7.5 seconds, the renderer remained healthy with the full 218-element tree, and all 300 characters were observable
  • the harness field and original signed guest installation were restored after certification; the exact candidate was retained in the guest evidence cache

@f-trycua
f-trycua force-pushed the codex/fix-large-type-text-2861 branch from bd8afa2 to 358bd55 Compare August 4, 2026 23:07
@f-trycua
f-trycua marked this pull request as ready for review August 4, 2026 23:25
@f-trycua
f-trycua merged commit a6b87e0 into main Aug 4, 2026
28 checks passed
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.

cua-driver: bound or chunk large type_text payloads before MCP timeout

1 participant