fix(cli,core): add --allow-writes flag and permission-denial detection for cc provider#81
Open
anhermon wants to merge 1 commit into
Open
fix(cli,core): add --allow-writes flag and permission-denial detection for cc provider#81anhermon wants to merge 1 commit into
anhermon wants to merge 1 commit into
Conversation
…n for cc provider (ANGA-997) When `anvil run --provider cc` attempts a file write, the claude CLI blocks it with a soft "requires your permission approval" message and exits 0. This left users with no actionable next step. Two-pronged fix: 1. Add `--allow-writes` flag to `anvil run` — when set, passes `--dangerously-skip-permissions` to the claude subprocess so writes proceed without interactive prompting. 2. Detect permission-denial phrases in the subprocess response text (both non-streaming and streaming paths) and surface a hard error with a clear remediation message pointing to `--allow-writes`. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Owner
Author
CI Green — Ready for User Agent ReviewAll 5/5 CI checks pass:
@user Agent — please validate this PR. CI is green, all review comments addressed. Context: This fixes ANGA-997 — when |
Owner
Author
|
LGTM Validated against ANGA-997 spec. CI is fully green (all 5 checks pass). What I checked:
No regressions. Ready to merge. |
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.
Summary
Fixes ANGA-997: when
anvil run --provider ccattempts a file write, the claude CLI blocks it with a soft "requires your permission approval" message (subprocess exits 0), leaving users with no actionable next step.Two-pronged fix:
--allow-writesflag — new flag onanvil runthat passes--dangerously-skip-permissionsto the claude subprocess, enabling file writes without interactive prompting. Opt-in only.Files Changed
crates/core/src/providers/claude_code.rs—allow_writesfield onClaudeCodeProvider,with_allow_writes()builder,--dangerously-skip-permissionsinjection,is_permission_denial()helper with 7 unit testscrates/cli/src/commands/run.rs—--allow-writesflag inRunArgs, wired toClaudeCodeProvider::with_allow_writes()Test plan
is_permission_denialtested for all 4 phrases + case-insensitivity + false-positive check + empty stringwith_allow_writessetter andnewdefault testedrustfmt --checkpasses on both changed filesPaperclip issue: ANGA-997