Skip to content

fix(computer-use): never expose the host process as a root - #337

Merged
Tryanks merged 1 commit into
mainfrom
fix/computer-use-skip-self-process
Sep 6, 2026
Merged

Tryanks merged 1 commit into
mainfrom
fix/computer-use-skip-self-process

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • computer_use observing tcode's own window crashed the app with SIGABRT: AppKit serves in-process AXUIElementCopyAttributeValue on the calling tokio thread, which invokes gpui's accessibility callbacks off the main thread; the resulting panic crosses an extern "C" boundary and aborts.
  • Exclude the host pid from list_roots (the single source of every root ref, including the frontmost fallback and --cu-smoke), skip own windows on macOS before any AX query, and return a clear error when find_roots is called with the host pid.

Test plan

  • cargo fmt --all --check
  • cargo clippy -p computer-use-mcp --all-targets --locked -- -D warnings
  • cargo test -p computer-use-mcp --locked (42 passed)

In-process accessibility queries run tcode's own accessibility callbacks
on the calling tokio thread, which panics inside the extern "C" boundary
and aborts the app (observed as SIGABRT when observe_ui targeted tcode's
own window). Exclude the host pid from root enumeration and reject an
explicit pid filter for it with a clear message.
@Tryanks
Tryanks enabled auto-merge (squash) September 6, 2026 09:08
@Tryanks
Tryanks merged commit b21140b into main Sep 6, 2026
7 of 8 checks passed
@Tryanks
Tryanks deleted the fix/computer-use-skip-self-process branch September 6, 2026 09:20
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