Repository navigation
THI-422: Allow matches Bash prompts that show "This command requires approval" - #52
Merged
Merged
Conversation
…, not the command, so Allow matches python3 -c prompts (THI-422) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… arithmetic; the docstring says where it starts and ends (THI-422) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ays in the block, pinning the end-only skip (THI-422) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…requires approval" capture (THI-422) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s approval" row, and the facts list records the row (THI-422) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Follow-up to #40 (THI-422), found during the hand checks. It replaces #51: same change, with the branch now on
originand the review's four fixes added.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_matcheshashed 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_matchesskips that exact row, and only that row, when it sits at the end of the block and shallower than the command (_TRAILING_CHROME):The block's bounds are two
_is_shallowrules: drop the leading Tip rows, then drop known trailing rows.Tests:
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,parse_panereading it as needs-input, and Allow throughPOST /api/pane/permission;⚠ Sandbox disabledin that position fails; the known text above the description, or at indent 3, is part of the command;Docs: the 2b spec's Bash matching rule names the skipped row, and its "Facts checked" list records it.
Assumption left open: the match is on the row's exact text. If Claude Code rewords it, Allow on those prompts answers 409 again (fails closed), and the new wording needs adding to
_TRAILING_CHROME.pytest 2031 ·
bin/checkclean.🤖 Generated with Claude Code