Skip to content

Answer permission and plan cards with y / n / a, even from the composer - #1670

Merged
currentbits merged 3 commits into
mainfrom
coder/keyboard-first-permission-answers-y-n-a--6b65e3
Oct 18, 2026
Merged

currentbits merged 3 commits into
mainfrom
coder/keyboard-first-permission-answers-y-n-a--6b65e3

Conversation

@currentbits

@currentbits currentbits commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #477. Permission and plan cards now answer from the keyboard, like the CLIs: y accepts or approves the plan, n denies or keeps planning, and a always-allows. The a key uses #1666's prefix rule (npm test:*, or whatever you typed in the rule field), not the whole tool.

Changes

  • y / n / a while a card is pending. A pending permission outranks typing: the keys are taken from a focused composer too, in the capture phase, so the composer never sees them. The card's own fields (the command, the rule, plan notes) and every other input keep their keys. Keys with modifiers pass through, and once a card is answered it stops taking keys.
  • Guardrail-flagged cards (risky commands, CI-workflow sign-off) never take keys from the composer. The keys still work when focus is outside a text field, so a stray y mid-sentence can't approve something the guardrail called risky.
  • Key hints on the buttons (y Accept · a Always allow npm test:* · n Deny; y Approve plan · n Keep planning), plus aria-keyshortcuts.
  • site/docs.html documents the keys and the "outranks typing" rule.

Verification

  • tsc --noEmit and vite build pass.
  • Renderer: the permission, plan, composer, thread view and question suites pass (498 tests). New tests cover y/n/a from a focused composer with the keydown never reaching it, a sending an edited rule, fields that keep their keys, guardrail cards ignoring the composer, Cmd+A passing through, and the hints on the buttons.
  • Electron site tests pass (17). The PR no longer touches electron/.
  • Not tested: I haven't clicked through it in the running app.

Notes for reviewers


claude-opus-5-5 via Claude Code

🤖 Generated with Claude Code

…nd prefix, not all of Bash (#477)

While a tool permission or plan card is pending, y accepts/approves,
n denies/keeps planning, a always-allows. Pending permission outranks
typing: the keys are taken from a focused composer (capture phase, never
typed). The card's own fields keep their keys, and guardrail-flagged
cards never take keys from the composer.

Allow-always on a Claude shell command now adds a session rule for the
command prefix (npm test:*), editable on the card, instead of the whole
tool. "Allow any Bash" stays as an explicit button with no key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T20:34:21.848833Z 66ee251 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66ee251e9f

ℹ️ 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".

Comment thread electron/runner-permissions.js Outdated
Comment on lines +513 to +519
if (decision === "allowAlways" && !governed) {
// Unedited: whole-tool session rule (matches today's Accept all).
// Edited: prefix of the *edited* command, never the original (#509).
// Command prefix (or the user's glob), not the whole tool (#477).
response.updatedPermissions = [
sessionAllowRule(pending.toolName, resolved.next, {
edited: resolved.edited,
}),
sessionAllowRule(
pending.toolName,
resolved.field ? resolved.next : null,
input.alwaysRule,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply the displayed rule to governed session grants

When a thread has an agent profile with rules and the current call is not covered by profile.ask, the card still offers an editable prefix such as npm test:* (and even “allow any Bash”), but this !governed branch skips alwaysRule entirely; the preceding logic stores only recheck.actionHash, which includes the complete command (electron/governance.js:236-243). Consequently, approving npm test:* only suppresses the identical command and another command under that prefix prompts again. Either implement prefix matching within governed session grants while retaining policy precedence, or avoid presenting the prefix/whole-tool choices in this context.

Useful? React with 👍 / 👎.

… n / a on top

#1666 landed #479 on main with the same shape as this branch's narrowing
(alwaysRule, "*" for the whole tool). Take main's backend, IPC and card
UI as-is; this branch now only adds the keyboard layer (#477): y / n / a
on permission and plan cards, key hints, the composer marker, and tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@currentbits currentbits changed the title Answer permission and plan cards with y / n / a, and always-allow a command prefix instead of all of Bash Answer permission and plan cards with y / n / a, even from the composer Oct 18, 2026
@currentbits
currentbits merged commit f32da6e into main Oct 18, 2026
6 checks passed
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.

Keyboard-first permission answers: y / n / a, like the CLI

1 participant