Skip to content

fix(computer-use): drop the window border overlay, gate the cursor on foreground - #319

Merged
Tryanks merged 2 commits into
mainfrom
fix/computer-use-overlay
Sep 2, 2026
Merged

fix(computer-use): drop the window border overlay, gate the cursor on foreground#319
Tryanks merged 2 commits into
mainfrom
fix/computer-use-overlay

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove the glowing gradient window border overlay (border.rs and its ffi/geometry helpers). It was drawn on every action and only ever hidden when the show_agent_cursor setting was toggled off, so it lingered on screen indefinitely.
  • The cursor panel still tracks every action (input is delivered in the background) but is only visible while the target app is frontmost. A 200 ms main-queue poll (dispatch_after_f) re-checks the frontmost pid so the cursor hides as soon as the user switches away and reappears in place when they switch back. The poll disarms when the target process exits or the overlay is disabled.
  • First show lands the panel directly on the action point instead of animating in from off-screen.
  • overlay/ shrinks from 1265 to 925 lines; #![allow(dead_code)] removed.

Verification

  • cargo fmt --all --check, cargo clippy -p computer-use-mcp --all-targets -- -D warnings, cargo test -p computer-use-mcp (42 passed), cargo build pass locally.
  • Manual: a throwaway probe clicked the centre of a TextEdit window and ran [NSApp run]; screenshots show the cursor at the click point while TextEdit is frontmost, gone after activating Finder, and back in place after re-activating TextEdit.

… custom window

Claude models now default the Context Window option to their native window
(200k for Sonnet 4.6 / Opus 4.6, 1M for Fable 5/5.1, Opus 5, Sonnet 5,
Opus 4.7/4.8; the latter two gain the option). Selecting the default emits no
launch flags; a smaller window is passed as `--settings {"autoCompactWindow":N}`
and `[1m]` is only appended to expand a native-200k model.

The picker gains a Custom row with an inline input (500k / 500000 / 500,
100k–1M). Changing the window while the provider is live restarts it before
the next turn and records a `ContextWindowChanged` timeline divider under the
user message. The composer's context meter is clamped to the selected window.
… foreground

The agent overlay drew a four-layer glowing gradient border around the target
window on every action and never hid it (`clear()` only ran when the setting
was switched off), so borders lingered on screen indefinitely. Remove the
border entirely.

The cursor panel keeps tracking every action (input is delivered in the
background), but is only ordered on screen while the target app is frontmost.
A 200 ms main-queue poll re-evaluates the foreground app so the cursor hides
the moment the user switches away and reappears in place when they switch
back; the poll disarms when the target exits or the overlay is disabled. The
first show lands the panel directly on the action point instead of sliding in
from off-screen.

overlay/: 1265 → 925 lines.
@Tryanks
Tryanks merged commit 30a61a7 into main Sep 2, 2026
3 checks passed
@Tryanks
Tryanks deleted the fix/computer-use-overlay branch September 2, 2026 20:56
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