Repository navigation
fix(desktop): harden macOS background computer use - #3434
Merged
Merged
Conversation
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.
Summary
Harden macOS background Computer Use when optional AX hit testing times out, the target loses its local focus, modifier chords are cancelled, or Stop races with input cleanup. Visual input keeps one window-directed delivery path, focus preparation is invalidated by a passive target-local loss monitor, and cancellation releases only the original process/window with validated routing.
Add a scoped production-tool JSONL probe, an independent passive foreground witness, and native timeout/focus-loss regressions. Record real-app comparisons with the installed Codex CUA implementation and remove unsupported parity claims. No new application-specific dispatch rules or foreground restoration are introduced.
Type and Areas
Type: Bug fix, tests, documentation.
Areas: Desktop / macOS native Computer Use.
Motivation / Impact
Background control should recover through target-local mechanisms instead of asking to take over the user's foreground. The change preserves explicit errors for AX mutations and invalid targets, prevents duplicate pointer delivery after an optional read failure, fixes modifier release flags, and serializes cleanup before capture teardown.
Verification
cargo test -p openbitfun-desktop --features devtools --lib computer_use -- --test-threads=1: 181 passed, 9 opt-in native tests ignored.pnpm run check:repo-hygiene,git diff --check, and Node syntax checking passed.-Wall -Wextra -Werror; read-only baseline/signal/output checks passed.typeTextcalls omitted Chinese/emoji; static layout lookup is consistent with that observation.cargo build -p openbitfun-desktop: passed.node scripts/test-macos-input-controls.mjs --orchestrationandnode scripts/test-macos-input-controls.mjs --busy-ax. They retained the independent foreground/key-window, stacking, observer-input and physical-cursor assertions. The AX timeout case delivered exactly one pointer down/up and one activation; an additional read-only witness recorded 122 samples with an unchanged hardware mouse-movement count. Earlier gated runs and runs with cursor movement were not counted as passes.80f6889c6cdd2a53ee6e4b3f3683040f8c73f98b: all 11 applicable checks succeeded, including Linux/macOS/Windows Rust and CLI checks, Frontend Build and the Rust / CLI Validation aggregate. The two impact-selected jobs were skipped by the existing workflow policy.Reviewer Notes
The REA comparison covers shipped macOS capture, routing, focus, input, menus, cancellation and foreground behavior; it does not recover the full closed-source implementation. Source hash, evidence boundaries and reproducible commands are in the existing architecture/module guides.
No dependencies, persisted shapes or cross-version wire contracts change. Windows/Linux native delivery and remote workspace, remote control, Peer Device Mode and Detached Dispatch were not exercised; local checks do not establish remote behavior.
Checklist