Repository navigation
fix(cua): recover revoked control and isolate cleanup failures - #6522
Merged
Merged
Conversation
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
3 of 6 tasks
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_closedbefore 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
-D warnings; macOS passed with exceptions for four existing lint categories in unchanged platform code.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.