Skip to content

Fix macOS action cursor updates and session-scoped cleanup - #381

Merged
Tryanks merged 3 commits into
mainfrom
fix/359-macos-cursor-lifecycle
Sep 8, 2026
Merged

Tryanks merged 3 commits into
mainfrom
fix/359-macos-cursor-lifecycle

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Fixes #359.

On macOS, the first action marker appeared but later moves and drag endpoints stayed at its original position. Calling the AppKit animator with setFrame:display: delivers subsequent positions; untargeted keyboard actions now use the target window center for feedback. Hidden-panel reveal and drag-start placement use a zero-duration frame animation to supersede any older animation still running after hide/show.

Feedback expires one second after submission (including callback delay), with retirement checked every 200 ms. Stop, turn completion, request cancellation/failure, disable, session shutdown and mounted-service teardown invalidate feedback. Closed or hidden target windows retire it. Publication revisions reject delayed callbacks; session/request ownership prevents one session's Stop or an older request's cleanup from clearing another session's newer marker. Runtime uses existing per-session MCP registrations, following Preview's pattern. Registration metadata has no Drop cleanup. Foreground gating and mouse passthrough remain in the native owner.

Validation:

  • Actual production backend action sequence on macOS 26.6.2 (25G83), arm64, one display: click → move → scroll → key → drag, at 1000px and 600px widths in light and dark themes, using dedicated test apps and an isolated profile. Baseline revision: cacab223d81d6cc23badc81c1bfbefc827fccb62. Baseline click (400,466) then move (800,666) left the native frame at (396,461); fixed move reached (796,661). Input delivery and marker movement were checked separately.
  • Reverting only the animator call reproduced the failure: ('move', [{'Height':40,'Width':40,'X':196,'Y':461}], (596,661)). Restoring the fix passed the full sequence. Background hide, foreground return within lifetime, background action without activation, expiry, disable and re-enable passed.
  • Deterministic production-owner regressions cover expiry, superseded/delayed callbacks, cancellation ownership, mounted-service lifetime, MCP cancellation and runtime Stop/shutdown registration wiring. Removing the ownership guard makes the session-race regression fail; restoration passes all 40 computer-use library tests. Runtime registration regression passes.
  • Full workspace formatting, Clippy (--all-targets --locked -- -D warnings), build and tests; iOS simulator, Web and Android checks with RUSTFLAGS='-D warnings'; dependency hygiene pass on final integrated head 07006fb7e. Commands: cargo fmt --all --check, cargo clippy --workspace --all-targets --locked -- -D warnings, cargo build --workspace --locked, cargo test --workspace --locked; cross-target commands match the linked CI workflow. Android uses CI NDK 27.1.12297006. Local cargo machete treats its subcommand as a directory; direct cargo-machete . (0.9.2) passes.

The opt-in native regression passed on pre-integration head 69bd0aade6796125f2d89a2a3d0dc2ad8b9f0848 (production overlay unchanged on final integrated head 07006fb7e5f970fbbdbb585fe37a9405379ef83f): cargo test -p computer-use-mcp --test macos_overlay --locked -- --ignored. On preceding head dcfb8e92f, it exposed an actual in-flight animation overwriting the new marker after move → hide → new click; applying the zero-duration animator correction made the same test pass. The test checks actual native move/drag frame deltas, rapid hide/show, passthrough, unchanged foreground, actual CG window visibility before/after native close, and production rejection of late feedback for that closed window. Default workspace tests explicitly report this desktop test ignored. The temporary GUI example was removed. Final integrated source, native evidence and exact-head CI results were independently reviewed and accepted.

No other-platform native behavior or multiple-display verification is claimed. The build emits the existing large __eh_frame linker warning and the dependency block 0.1.6 future-compatibility notice. No new localized UI strings were introduced; DESIGN and the computer-use lifecycle documentation describe the behavior. Evidence screenshots and exact red/green logs are retained locally under /tmp/tcode-359/ for lead review.

Final integration: rebased onto cd83cdda9cb01f0a22ef9d8a57f85f219c71725e, preserving merged #380 usage and #382 sidebar behavior. All three commits are patch-equivalent in git range-diff; no conflict resolution or semantic changes were needed. Runtime retains the new ContextCompacted(_) event shape and adds only session feedback cancellation at TurnCompleted; DESIGN retains both merged sections. Combined-head formatting, full workspace Clippy/build/tests, dependency hygiene and iOS/Web/Android checks all pass. Workspace tests report 1101 passed, zero failed, five ignored, plus the explicitly ignored native runner. Exact-head CI run 34223690533 passed all six jobs on 07006fb7e5f970fbbdbb585fe37a9405379ef83f.

@Tryanks
Tryanks marked this pull request as ready for review September 8, 2026 11:51
@Tryanks
Tryanks force-pushed the fix/359-macos-cursor-lifecycle branch from 69bd0aa to 07006fb Compare September 8, 2026 12:00
@Tryanks
Tryanks merged commit 6aeef93 into main Sep 8, 2026
6 checks passed
@Tryanks
Tryanks deleted the fix/359-macos-cursor-lifecycle branch September 8, 2026 12:13
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.

Computer Use action cursor still freezes after drawing and is not cleared

1 participant