Repository navigation
feat(computer-use): ask for missing macOS permissions in the conversation - #6588
Merged
Merged
Conversation
Native Computer Use on macOS needs Accessibility and Screen Recording, which macOS grants to the application that started the Host. Without them the first AX call failed with an opaque -25211 deep inside a tool. Check both grants before native work, ask macOS to show its request the first time one is missing, and fail with a single permission_required: line naming the application to allow. The check is a real call (an AX query to this user's Dock, a ScreenCaptureKit listing), because AXIsProcessTrusted and CGPreflightScreenCaptureAccess keep their first answer in a Host without a run loop; a grant the user turns on is seen by the next call without restarting the Host. A confirmed grant is remembered, and failures that a missing grant explains (AX -25211, a refused ScreenCaptureKit listing) check again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS grants privacy permissions such as Accessibility and Screen Recording to the application responsible for a process. The Host belonged to whichever application started it first: Maka, or the terminal a CLI ran in. Users had to find and allow that application, and a grant could follow the wrong one. Maka.app now carries Helpers/Maka Host.app. Its executable starts itself again with responsibility disclaimed and runs the Host, passing stdio through, forwarding termination signals and returning the Host's status. Interactive, activation and launchd starts run the Host through it, so its grants belong to "Maka Host". macOS ties a grant to the bytes of the helper's executable, and each package lives in a directory of its own. The helper is therefore copied once into the account data directory and replaced only when a package carries a higher bundle version. Without a helper, the Host runs directly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion When native Computer Use needs Accessibility or Screen Recording and the Host lacks it, the Host asks macOS to show its request and then shows a System permission request card in the conversation. The card names the missing grants and opens the matching System Settings pane. The Host checks the grants every 1.5 s while the card is open and continues the tool call as soon as they are on, with no retry and no restart. Cancelling the card fails the call with the permission_required lines. With request_permissions off, the call fails at once as before. The new system_permission interaction can only be cancelled by the user; only its producer commits SystemPermissionGranted, and it cannot time out. ACP clients get a prompt whose only option is Cancel, and a prompt whose interaction settles elsewhere no longer holds the session in RequiresAction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rmissions-20261103
Generated-by: Codex
Generated-by: Codex
Keep permission waits cancellable without arbitrary ACP deadlines or count limits. Propagate producer outcome persistence failures through the existing cleanup path. Generated-by: Codex
M4n5ter
reviewed
Nov 3, 2026
M4n5ter
left a comment
Member
There was a problem hiding this comment.
English
The review fixes are pushed in b3c4b55a6. This branch includes the updated #6582/#6587 and the latest rust-preview, with no merge conflicts.
- Request permissions for the actual operation. Documentation, browser setup, inventory and cursor configuration no longer wait for unrelated native grants. Native observation requests Accessibility and Screen Recording; audio start requests Screen Recording, and stopping audio does not open a permission card.
- Keep human permission waits cancellable without an arbitrary deadline. Removed ACP's five-minute response timeout and its fixed 16-callback/1,024-interaction limits. Connection shutdown and cancellation still end the wait.
- Propagate persistence failures. A failed producer outcome write now follows the existing withdrawal/cleanup path, preserving the error cause, instead of stopping detection and waiting for an outcome that was never committed.
- Remove the unsupported application-name cap. Removed the 256-character limit, its fixed-number rejection assertion and the corresponding generated schema constraint. Added a focused regression test for browser setup/documentation, with native app binding and audio permission requirements as positive controls.
Validation: related nextest tests 6/6, packaging tests 9/9, compilation, Clippy with warnings denied, SDK type checking and generated-schema consistency checks all passed locally. The macOS permission flow was not exercised on this WSL machine. The new GitHub CI run is currently queued.
简体中文
已在 b3c4b55a6 补上评审中的修复。该分支已包含更新后的 #6582/#6587 和最新 rust-preview,没有合并冲突。
- 按实际操作请求权限。 文档、浏览器初始化、清单查询和光标配置不再等待无关的原生权限。原生观察请求 Accessibility 和 Screen Recording;启动音频录制只请求 Screen Recording,停止录制不会弹出权限卡片。
- 用户授权等待保留取消能力,不设置任意期限。 删除 ACP 的五分钟响应超时,以及固定的 16 个回调、1024 条交互上限。连接关闭和取消仍会结束等待。
- 传播持久化错误。 producer 写入授权结果失败时,保留错误原因并走已有的撤回与清理路径,不再停止检测后等待一个从未成功写入的结果。
- 删除没有依据的应用名上限。 移除 256 字符限制、固化该数字的拒绝断言及对应生成 schema 约束。补了一个针对浏览器初始化和文档读取的回归测试,并用原生应用绑定、音频所需权限作为正向对照。
验证:相关 nextest 测试 6/6、打包测试 9/9,编译、Clippy(警告视为错误)、SDK 类型检查和生成 schema 一致性检查均通过。WSL 下未实测 macOS 授权流程。新的 GitHub CI 目前仍在排队。
Generated-by: Codex
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.
Stacked on #6582 and #6587.
When a Computer Use operation needs Accessibility or Screen Recording and the Host lacks the required grant, the Host asks macOS to show its own request and then shows a System permission request card in the conversation:
permission_requiredlines from fix(computer-use): report missing macOS permissions before native work #6582. The REPL stays usable.request_permissionsoff, the call fails at once with the same lines, as before.To grant ahead of an unattended run, ask for one screenshot first. The card appears, and once granted the permissions persist.
Choices the diff does not explain on its own:
system_permission. The user can only cancel it (system_permission_cancelbecomes aproducer_cancelledclosure). Only the producer commitssystem_permission_granted. A user answer cannot claim the grants are on, because the operating system decides that. Likecomputer_app, it cannot time out: the cell timeout is suspended while the card waits.computer_appapprovals do. Concurrent commands in one cell each get their own card instead of conflicting.RequiresActionand a callback slot. ACP cannot withdraw a prompt, so the client's dialog itself stays open until dismissed.Review follow-up
Permissions are selected for the actual command: documentation, browser setup, inventory and cursor configuration do not wait for unrelated native grants; native observation requires Accessibility and Screen Recording, and audio start requires Screen Recording. Permission-result persistence failures now propagate through the existing withdrawal path. ACP no longer imposes the unrelated five-minute response deadline or fixed interaction-count limits. The arbitrary application-name length limit and its fixed-number assertion are removed, and generated schemas are updated. The branch includes the updated lower PRs and latest
rust-preview.AI use
Tool(s) and scope: Claude Code wrote the change and this description and drove the live checks on macOS 26.6; the commit carries
Co-Authored-By: Claude Opus 5.5. Codex implemented the review follow-up fixes.