Skip to content

THI-422: Allow matches Bash prompts that show "This command requires approval" - #51

Closed
tdody wants to merge 1 commit into
tomplex:mainfrom
tdody:feature/notify-approval-row
Closed

tdody wants to merge 1 commit into
tomplex:mainfrom
tdody:feature/notify-approval-row

Conversation

@tdody

@tdody tdody commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #40 (THI-422), found during the hand checks.

For some Bash commands (python3 -c …), Claude Code 2.1.280 adds a row under the description, This command requires approval, at indent 1. dialog_matches hashed it as part of the command block, so the digest never equalled the hook's key and every Allow on such a prompt answered 409. That failed safe, but those prompts couldn't be allowed.

The change. dialog_matches skips that exact row, and only that row, when it sits at the end of the block and shallower than the command (_TRAILING_CHROME):

  • any other shallow row there still stays in the block, so unknown chrome fails closed;
  • the same text at the command's indent is part of the request.

Tests:

  • a new real capture, tests/fixtures/permission_dialogs/bash_requires_approval.txt, added to every list of real captures: parse, own key, no other key, the hook's own key, and parse_pane reading it as needs-input;
  • negative cases: ⚠ Sandbox disabled in that position fails, and the known text at indent 3 is part of the command;
  • a mutation check: with the skip disabled, 3 tests fail.

pytest 2030 · bin/check clean.

🤖 Generated with Claude Code

…, not the command, so Allow matches python3 -c prompts (THI-422)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@tdody

tdody commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Replaced by #52: same change, with the branch on origin and the review's four fixes added.

@tdody tdody closed this Oct 30, 2026
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.

1 participant