Skip to content

fix(computer): report macOS permissions from the active automation helper - #42138

Draft
Digitally-Challenged wants to merge 2 commits into
stablyai:mainfrom
Digitally-Challenged:fix-active-helper-permissions
Draft

Digitally-Challenged wants to merge 2 commits into
stablyai:mainfrom
Digitally-Challenged:fix-active-helper-permissions

Conversation

@Digitally-Challenged

Copy link
Copy Markdown

ELI5

When Computer Use can't read a window, orca computer permissions can 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

  • The native macOS helper answers a new permissionStatus request with its own Accessibility and Screen Recording trust.
  • getComputerUsePermissionStatus asks 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".
  • The helper's reply is parsed rather than cast: anything unrecognized reads as not-granted, so a malformed reply never reports a grant.
  • When a window read times out, the helper now checks its own trust before choosing the error: permission_denied only when it really is untrusted, otherwise accessibility_error saying 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-state read 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 --json and orca computer get-app-state output on a macOS machine where the automation helper has lost its Accessibility grant.

Testing

  • pnpm check:changed (25 checks) passes; swift build of native/computer-use-macos passes.

  • 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 permissionStatus call fails while a helper is running, orca computer permissions now reports that error instead of a separate helper's result. Non-macOS providers return null, so they keep the existing path. A helper build without permissionStatus would 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:

  • Cross-platform: macOS only. Linux/Windows providers don't implement permissionStatusIfStarted, so the sidecar returns null and behavior is unchanged.
  • SSH/remote: no wire or protocol changes beyond a new local sidecar method; no paired-client impact.
  • Agents/integrations: agents get a more accurate error code (accessibility_error vs permission_denied) on trusted-but-no-window timeouts; accessibility_error is already an existing code that the CLI guidance handles.
  • Performance: removes a helper launch when an automation helper is already running; adds one trust check on the existing timeout path only.
  • UI: none.
  • Security: reads trust status only; the reply is validated, and nothing new is granted or prompted.

🤖 Generated with Claude Code

Digitally-Challenged and others added 2 commits November 13, 2026 09:34
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

No deployments
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.

[Bug]: "Orca Computer Use" loses Accessibility grant after every app update (permissions reports granted, AX reads denied)

1 participant