Repository navigation
fix(computer): report macOS permissions from the active automation helper - #42138
Draft
Digitally-Challenged wants to merge 2 commits into
Draft
Digitally-Challenged wants to merge 2 commits into
Digitally-Challenged wants to merge 2 commits into
Conversation
Parse the running helper's permissionStatus reply so unrecognized values read as not-granted rather than passing through a type assertion. Replace the sidecar's callIfRunning with an isRunning check so sidecar-client stays within the 300-line limit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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.
ELI5
When Computer Use can't read a window,
orca computer permissionscan still say "Accessibility: granted", because it asks a freshly launched copy of the helper instead of the copy that's actually doing the work. This change asks the running helper, so the permission report matches what agents experience.What Changed
permissionStatusrequest with its own Accessibility and Screen Recording trust.getComputerUsePermissionStatusasks the running automation helper first (through the computer-use sidecar), and only launches the separate status helper when no automation helper is running. If the running helper's probe fails, that failure is surfaced instead of being replaced by a separate helper's "granted".permission_deniedonly when it really is untrusted, otherwiseaccessibility_errorsaying the helper is trusted and pointing at the window/desktop/lock state. Before, every such timeout told users to toggle Accessibility.Why
In #20078, the status helper and the automation helper can disagree after an update: the report says granted while every
get-app-stateread is denied, and the denial message itself can be a false positive (see the latest comment there). Asking the process that performs the reads removes that disagreement, without launching an extra helper while one is already running.Linked Issue
Fixes #20078 (the reporting half: the status and the error now reflect the running helper's real trust. It does not change why macOS drops the grant after an update.)
Maintainers: please keep #20078 open after this merges (or reopen it), since the grant loss after updates is still unsolved.
Visual Proof
PENDING — before/after
orca computer permissions --jsonandorca computer get-app-stateoutput on a macOS machine where the automation helper has lost its Accessibility grant.Testing
pnpm check:changed(25 checks) passes;swift buildofnative/computer-use-macospasses.New tests: the client reads permission status from the running helper over its own socket and never spawns one just to ask; a malformed reply never reads as a grant; the status path reports the running helper's denial and surfaces its probe failure, without launching the separate helper. All four fail against
main's sources and pass with this change.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Risk
Level: Low
The riskiest part is the new status path: if the sidecar's
permissionStatuscall fails while a helper is running,orca computer permissionsnow reports that error instead of a separate helper's result. Non-macOS providers return null, so they keep the existing path. A helper build withoutpermissionStatuswould reject the call; the helper ships with the app, so versions match. A plain revert backs it out completely.Review
AI coding agent (Claude Code) summary:
permissionStatusIfStarted, so the sidecar returns null and behavior is unchanged.accessibility_errorvspermission_denied) on trusted-but-no-window timeouts;accessibility_erroris already an existing code that the CLI guidance handles.🤖 Generated with Claude Code