feat(computer-use): 2.0 background delivery, activation, overlay, harness - #315
Merged
Conversation
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Computer Use 2.0 — background input delivery (macOS)
Follows the techniques in pi-computer-use and kwwk-computer-use-core. The computer-use tools now drive target apps without stealing focus or moving the real cursor.
What changed
backend/macos/background.rs): mouse/keyboard/scroll/drag fallbacks are addressed to the target process viaCGEventPostToPidwith the required window-addressing fields (pid 39, window 51, routing 58, mouse window 91/92) and optional SkyLight window-local coordinates. AX-first (AXPress/AXValue) behavior is unchanged.appKitDefinedprimer (subtype 1 on acquire / 2 on release) and a window-center primer. The user's frontmost window stays put.ax.rs): setsAXManualAccessibility/AXEnhancedUserInterfaceand registers anAXObserverso background Chromium exposes its full tree (private_AXObserverAddNotificationAndCheckRemotewith public fallback).backend/macos/overlay/): a click-through, non-activatingNSPanelcursor + colorful window halo showing where the agent acts (never moves the real pointer; all UI marshalled to the main queue; no-op when disabled).delivery(ax/background_pid/foreground_hid/none) and transaction-levelactivation.<computer_use_harness>block with observation sequence, recent actions, candidate targets, and stable-label deltas (since previous / initial).show_agent_cursor(default on) andallow_foreground_fallback(default off — keyboard-only, never pointer), with en/zh-CN i18n.Every private API (SkyLight, per-PID taps,
appKitDefined, private AX observer symbol) degrades gracefully — missing symbol / nil / tap-create failure falls back or reportsdidnt; nothing panics.Testing
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --locked, process-helper boundary check,--locked(no Cargo.lock drift).1297 → 1297); background pointer click likewise kept focus. Both reporteddelivery: background_pid.Notes / limitations