Skip to content

fix(cua): recover revoked control and isolate cleanup failures - #6522

Merged
M4n5ter merged 1 commit into
rust-previewfrom
fix/cua-control-recovery
Nov 1, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
fix/cua-control-recovery

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 1, 2026

Copy link
Copy Markdown
Member

Problem and behavior

After browser extension control was revoked, an explicit tab claim could still be refused. A cleanup failure then shut down the shared Computer service, and a CUA state hint queried before every model request made subsequent ordinary messages fail with computer_closed before reaching the model.

Remove that hint preflight, recover the exact revoked tab through actual fence/drain/retire and fresh attach ACKs, and isolate cleanup failure to its original VM/resources. Pending operations keep their original ownership and are joined; terminal cleanup failure can retry cleanup without replaying the user action. Browser drains happen outside the shared Host lock, and stale turn cleanup cannot fence a newer turn’s page.

Windows keeps a failed-close worker for actual retry. Linux serializes physical input ownership, confirms the previous owner’s release before switching, and retains failed ownership for recovery. No shared shutdown is used as a cleanup-error flag.

Remove the arbitrary 16-session and 50 MiB output caps, forced browser timeout ceilings (reads, mutation, evaluation, waits, downloads and chooser), and the Host binding’s fixed lifetime. Explicit operation timeouts are honored within representable platform durations. Browser API documentation is updated in English, Simplified Chinese and Traditional Chinese.

Depends on maka-agent/cua#2, pinned to 7dfc429ba3db0568c46c49f633b724750f34f451, for actual claim drain settlement, host-owned SDK lifetime, and libei recovery. No live user database or running Maka instance was changed.

Verification

  • macOS computer-use native library: 276 passed, 5 ignored.
  • Linux computer-use native library: 262 passed, 3 ignored.
  • Computer service library: 17 passed, 1 ignored; unavailable-CUA conversation regression: 1 passed.
  • CUA dependency: Core 1540 passed / 1 ignored, SDK 133 passed, Linux libei 3 passed; regenerated bindings drift check and TypeScript type check passed.
  • Real headless Chrome integration: 1 passed, including a 3.2-second evaluation within an explicit 8-second timeout.
  • Linux Clippy passed with -D warnings; macOS passed with exceptions for four existing lint categories in unchanged platform code.
  • ASF headers, relevant Rust formatting and diff whitespace checks passed. The Biome staged hook hung on a Rust input; the commit used the completed relevant checks instead.

Behavior coverage includes explicit reclaim after a real IPC revocation, reserving another page while the first drain waits, retaining original unknown-effect custody while sibling VMs work, retrying actual cleanup, and continuing an ordinary model conversation when CUA is unavailable. The ordinary-conversation regression was also run against the old preflight and failed, then passed with its removal. A real headless Chrome test evaluates for 3.2 seconds under an explicit 8-second timeout.

Windows shared worker behavior is covered by unit tests; real Windows and Wayland compositor input was not exercised. Strict macOS Clippy still reports existing diagnostics in unchanged platform files.

AI use

Codex contributed implementation, review and validation under m4n5ter’s direction.

Remove arbitrary session, output, timeout and host-lifetime caps. Keep failed cleanup with its original resources and permit actual cleanup retries while other sessions continue.

Generated-by: Codex
@M4n5ter
M4n5ter merged commit 1253f9e into rust-preview Nov 1, 2026
5 of 6 checks passed
@M4n5ter
M4n5ter deleted the fix/cua-control-recovery branch November 1, 2026 04:58
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.

1 participant