Repository navigation
fix: make the permission guide offer the launching app, see each grant, and leave no stale host - #330
Merged
Merged
Conversation
The shared workflow reference told agents to run permissions --request, which shows the macOS prompt and does not add a new app to the Accessibility list. The macOS skill already names --guide, which opens System Settings with the drag guide.
A denied Accessibility or Screen Recording permission told the user to open System Settings by hand, so users ran permissions --request and got the macOS prompt, which does not add a new app to either list. The hints now name permissions --guide, which opens the right list with the drag guide. The core PERM_DENIED hint named a macOS settings path, and Windows returns it on E_ACCESSDENIED. It now points at agent-desktop permissions, which gives each platform's own hint, and names --guide only as the macOS path. Automation keeps its hint because the guide does not cover it.
…rant The guide looked up each parent process with NSRunningApplication, which knows only apps registered with LaunchServices. Rex Server is not, so the walk reached launchd and the panel offered the agent-desktop binary. TCC charges the grant to Rex Server, so a drop of the binary never turned the permission on. The walk now reads each ancestor's executable path and takes its outermost app bundle, which is also the app TCC names for a helper inside an app. Each grant poll ran agent-desktop permissions, which goes to the shared command host. That host can belong to another terminal app, it keeps the Screen Recording answer it read at launch, and the poll every second kept it alive. The poll now runs a fresh process that reads the two preflight checks and exits before the CLI and the host. macOS 27 names the Accessibility list Device Control and Data Access, so the panel title, the hint and the macOS skill now use that name there. The title wraps. The aurora is fainter and lower.
A terminal starts the shell through /usr/bin/login, which root owns. The full BSD record from proc_pidinfo is refused for a process of another user, so the walk stopped at login and never reached the terminal app. The short BSD record has no such check.
A process keeps the Accessibility answer it read before a grant. The command host lives up to 15 minutes, so after the user granted Accessibility, every forwarded command still returned PERM_DENIED and permissions still reported denied. A snapshot through such a host failed while a fresh process on the same Rex Server succeeded. The host now exits after any reply that reports a missing permission, so the next call starts a host that sees the grant. Measured on macOS 26.0: after the grant, a fresh process snapshots and screenshots without a restart of the launching app, so the skill no longer asks for one and the guide's done screen no longer asks to reopen it. The guide also says in one line why each permission is needed, and the granted tick pops in, and draws on where macOS 26 supports it.
This was referenced Oct 30, 2026
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.
Why
On a Mac where the terminal is Rex,
agent-desktop permissions --guideshowed the agent-desktop binary in its panel, not Rex Server. After the user dragged it and confirmed, the panel stayed on "Allow Accessibility" andpermissionsstill reporteddenied. Also, the JSON hints and the shared workflow skill told users to run--request, which shows the macOS prompt and does not add an app to either list. On macOS 27 the Accessibility list has the new name "Device Control and Data Access".Causes and fixes
NSRunningApplication, which knows only apps registered with LaunchServices. Rex Server is not registered, so the walk fell back to the binary. TCC charges the grant to Rex Server, so the binary drop changed nothing. The walk is now in Rust (permission_guide.rs). It reads each ancestor's executable path and takes the outermost.app, which is also the app that TCC names for a helper such asCode Helper (Plugin).app./usr/bin/login.proc_pidinfo(PROC_PIDTBSDINFO)refuses a root-owned process. The walk usesPROC_PIDT_SHORTBSDINFO, which has no same-user check. The dogfood found this before the user saw it.agent-desktop permissions, which goes to the command host, and the poll every second kept that host alive. The poll now runs a fresh process withAGENT_DESKTOP_PERMISSION_GUIDE_PROBE. That process exits before CLI parsing and does not use the host.PERM_DENIEDafter the grant. In the dogfood, a snapshot through that host failed, but a fresh process on the same Rex Server succeeded. Now a host exits after any reply that reports a missing permission (src/command_host/mod.rs,command_host_socket.rs), so the next call starts a host that sees the grant.suggestiontext, the screenshotPERM_DENIEDhint, and the shared workflow skill now namepermissions --guide. The corePERM_DENIEDhint was a macOS settings path, but Windows also returns it onE_ACCESSDENIED. It now points atagent-desktop permissionsand names--guideonly as the macOS path. The macOS skill no longer says to restart the launching app (see the measurements), and its confirm step usessnapshot -i.snapshot --app Finder -ireturnsWINDOW_NOT_FOUNDwhen Finder has no window.isOperatingSystemAtLeastVersion:{27,0,0}is true (the release binary is built with SDK 26.5, so macOS reports its real version). The title wraps. A gray line tells the user why each permission is necessary. The granted tick pops in with a spring and draws on withNSSymbolDrawOnEffecton macOS 26. The aurora is fainter (opacity 0.55) and lower (96 pt). The done screen no longer tells the user to reopen the terminal.Dogfood on macOS 26.0, from Rex, with the release build
denied, and a snapshot through it returnedPERM_DENIED. That is fix 4.snapshot -ireturned 18 refs withcomplete: true. A screenshot showed real window content.tccutil resetof both grants: the why line was correct, and the tick drew itself in. Both grants landed and the guide closed.permissionsthen reported both permissions asgranted. A host started byversionbefore the grant did no trust check, and it saw the grant.Not driven on this Mac: the macOS 27 title, and the
Privacy_Accessibilityanchor in System Settings on macOS 27. Those rest on the user's report from a macOS 27 Mac.Accepted limits
PERM_DENIEDonce, then the host exits and the retry succeeds. "First contact" starts withpermissions, which stops such a host before the grant.granted. Its first Accessibility command fails withPERM_DENIED, and then it exits.Tests
the_guide_offers_the_outermost_app_bundle_of_the_launching_process: this test fails when the innermost bundle is taken.the_host_walk_passes_through_a_process_of_another_user: this test fails withPROC_PIDTBSDINFO.a_host_stops_after_it_reports_a_missing_permission: this test fails when the rule returns false.the_host_returns_after_a_reply_that_asks_it_to_stop: this test times out when the stop check is removed.-D warnings, the source-rule and architecture scripts, and every host test target pass on macOS.Test (Windows)failure wasinput::clipboard::tests::hung_delay_owner_returns_app_unresponsive, a clipboard timing test that this change does not touch.