Repository navigation
fix(computer-use): check permissions before opening target apps - #431
Merged
ZongYue99 merged 1 commit intoSep 15, 2026
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.
The native
get_app_statepath can launch an application while resolving it, before checking Accessibility access. Handling only the resulting permission error therefore opened both the target app and System Settings on a first attempt.Check native permissions before dispatching any tool to the local macOS
open_computer_useserver. The diagnostic uses the same configured launcher, prefix arguments, environment and working directory as MCP, replacing only the finalmcpargument withdoctor. The target application is never passed to the diagnostic. Missing access opens permission guidance and blocks Computer Use calls for that turn; a new user message triggers a fresh check. Unknown diagnostics fail closed, and cancellation during the check prevents dispatch. Linux, Windows and unrelated MCP servers retain their existing behavior.All tools on a connection share the turn check, including concurrent calls. A native permission failure after preflight also blocks subsequent Computer Use calls in that turn. Tool responses tell the agent to end the turn and avoid alternative executors; this change does not add a global execution guard to browser or shell tools.
Validation: 68 related tests passed across the focused MCP/permission suites and Computer History regressions. Coverage includes zero target calls on denied/unknown access, same-turn blocking after simulated authorization, fresh checks on a new message, concurrency, chat isolation, cancellation, and wiring through actual MCP registration. The bundled macOS 0.3.5 native diagnostic returned a verified
grantedstatus without invoking a target application. TypeScript checks, Agent build and diff checks passed. Denied-permission scenarios used fixtures; no existing OS grants were revoked or changed. Clean-machine signed-installer first-grant acceptance remains outstanding.