Repository navigation
Render Claude permission suggestions as a selectable picker - #9
Conversation
Claude permission requests can offer multiple permission suggestions (for example the exact command, a prefix glob, or all Bash). The built-in dialog previously collapsed them behind a single "Always Allow" button that applied every suggestion and only previewed the first rule. Show each suggestion as its own choice in a native choose-from-list picker: "Allow once" plus one entry per suggestion, labeled exactly as Claude sent the rule. Selecting a rule persists only that suggestion as a session rule; Deny or dismiss denies. The three-button dialog remains the fallback for non-macOS hosts, disabled osascript, or picker failures, and now lists every suggested rule.
|
/gemini review |
|
@codex review |
There was a problem hiding this comment.
Code Review
This pull request introduces an interactive, native permission picker for Claude Code permission requests on macOS using AppleScript. Instead of collapsing all permission suggestions under a single "Always Allow" button, each suggestion is rendered as a separate choice in a list picker, allowing users to persist only the specific scope they select. A fallback to the standard three-button dialog is provided if the picker is unavailable or fails. The review feedback identifies two key improvement opportunities: first, handling duplicate suggestion labels to prevent AppleScript from incorrectly returning the index of the first matching string, and second, treating an invalid or unparseable choice index as a transport failure rather than a user dismissal to ensure a graceful fallback to the standard dialog.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Code Review
This pull request implements an interactive permission picker for Claude Code permission requests, allowing users to select specific permission suggestions to persist as session rules. It adds a native macOS picker using AppleScript, with a robust fallback to the standard three-button dialog on unsupported platforms or transport failures. The review feedback identifies a potential out-of-bounds error in the AppleScript loop when fewer than four arguments are provided, and notes a limitation where duplicate option labels in the picker will always resolve to the first occurrence.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0870bcd9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When two permission suggestions render to the same label, choose-from-list returns only the selected text and the picker maps it back by first match, so a later duplicate would persist the first suggestion's rule. Append a counted suffix to duplicate labels so each maps to the correct suggestion; unique labels are left untouched. Also treat an "OK" picker status with a missing or out-of-range index as a transport failure rather than a successful dismissal, so the handler falls back to the standard dialog instead of silently denying the request.
|
Round 1 review addressed in 76b0ba0: Addressed (valid):
Skipped (invalid):
All 173 tests pass; ruff/prek clean. |
|
/gemini review |
|
@codex review |
|
To use Codex here, create an environment for this repo. |
There was a problem hiding this comment.
Code Review
This pull request introduces an interactive permission picker for Claude Code permission requests, allowing users to select and persist specific permission suggestions as session rules on macOS using AppleScript, with a fallback to the standard dialog on other platforms or in case of failure. The feedback highlights a robustness issue in format_permission_suggestions_preview where suggestions with empty rules might be omitted entirely from the preview instead of falling back to non-rule fields, and suggests a code change to handle this fallback correctly.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76b0ba0060
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…sible Round-2 review fixes: - The duplicate-label suffix is now generated against the set of labels already used, not just the base label, so a synthetic suffix like "foo (2)" can no longer collide with another suggestion's real label and persist the wrong scope. - format_permission_suggestions_preview now computes the non-empty rule labels first and falls back to the suggestion-level description (mode / directories / id) when a suggestion's rules all render empty, instead of dropping the suggestion from the fallback dialog.
|
Round 2 review addressed in 939d6e3 (both findings valid):
All 175 tests pass; ruff/prek clean. |
|
To use Codex here, create an environment for this repo. |
|
/gemini review |
|
@codex review |
There was a problem hiding this comment.
Code Review
This pull request introduces an interactive permission picker for Claude Code permission requests, allowing users to select and persist specific permission suggestions individually rather than accepting all suggestions at once. The implementation includes a new AppleScript picker (permission_choice.applescript) for macOS, updated schemas, fallback logic to standard dialogs when the picker is unavailable or fails, and comprehensive unit tests. No review comments were provided, and the implementation looks clean and complete.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Render Claude permission suggestions as a selectable picker
Why
Claude permission requests can offer several suggestions at different scopes (the exact command, a prefix glob, all Bash, a permission mode, etc.), but the built-in dialog collapsed them behind a single
Always Allowbutton that applied every suggestion and previewed only the first rule, so the user could neither see the full scope nor choose between them.How
PermissionRequestcarriespermission_suggestions, render a nativechoose from listpicker instead of the three-button dialog.Allow onceplus one entry per suggestion, labeled exactly as Claude sent the rule (for exampleBash(git *),Edit(src/**), Write(src/**), or a non-rule scope such asmode: acceptEdits). No editorialized "Always allow" prefix, since every entry belowAllow onceis inherently an always-allow.behavior: "allow"withupdatedPermissionscontaining only the chosen suggestion, scoped tosession;Allow onceallows with no persisted rule;Deny(or dismissing) denies.choose from listtransport protocol. On non-macOS hosts, disabledosascript, or a picker failure it falls back to the standard three-button dialog, which now lists every suggested rule instead of only the first.AskUserQuestionpayloads, which keep their own picker flow.What
PermissionChoice,PermissionChoiceDialogSpec,PermissionChoiceDialogResult; broadenDisplaySpecto include the picker and AskUserQuestion specs.permission_choice.applescript(choose from listwithSelect/Denybuttons).show_permission_choice_dialog+ cached script getter; rename the sharedchoose from listsentinels so the picker and AskUserQuestion flows reuse them.is_permission_choice_payload,build_permission_choice_dialog,build_permission_choice_response, anddescribe_permission_rule/describe_permission_suggestionhelpers;build_permission_dialognow lists every suggested rule (replacing the first-rule-only preview).handle_permission_choicewired intohandle_permission_requestahead of the standard-dialog fallback.AppleScriptInvocation.PERMISSION_CHOICE.osacompile), and the full handler flow (single-suggestion persistence, allow-once, deny, and skip/fail/no-picker fallbacks).Verification
uv run --group dev pytest-> 172 passed;ruff checkclean;prek --all-filespasses.agent-hooks callback --provider claude-code, confirming each suggestion appears as its own choice and that only the selected scope lands inupdatedPermissions.