fix(llm): run Claude background reviewers in auto permission mode#516
Merged
Conversation
Background Claude tasks launched with --permission-mode acceptEdits could block on read-only Bash requests (e.g. git diff): enabling the Bash tool does not approve its execution, so the reviewer stalled until the task timeout. Switch the --bg transport to --permission-mode auto. Foreground print mode (-p) keeps acceptEdits. validateArgs now enforces the transport-specific mode: auto with --bg, acceptEdits with -p, and rejects the wrong pairing for either transport. The issue text also proposed --enable-auto-mode; that flag was removed in claude CLI v2.1.111 (--permission-mode auto is the replacement), so it is deliberately not passed and not allowlisted. Closes #515
There was a problem hiding this comment.
Automated PR Review
Reviewed commit: 96cc1ac7d087
Profile: claude-rianjs-bot - Posting as: rianjs-bot[bot]
Summary
| Reviewer | Findings |
|---|---|
| go:implementation-tests | 0 |
Reviewer Coverage
| Reviewer | Status | Inspected | Skipped | Constraints |
|---|---|---|---|---|
| go:implementation-tests | complete_broad | internal/llmadapters/subprocess.go, internal/llmadapters/subprocess_test.go | unavailable | unavailable |
0 PR discussion threads considered. 0 summarized; 0 resolved.
Completed in 2m 11s | ~$0.91 (est.) | claude-sonnet-4-6 | cr dev
| Field | Value |
|---|---|
| Model | claude-sonnet-4-6 |
| Reviewers | go:implementation-tests |
| Engine | claude_cli · claude-sonnet-4-6 |
| Reviewed by | cr · rianjs-bot[bot] |
| Duration | 2m 11s wall · 1m 59s compute |
| Cost | ~$0.91 (est.) |
| Tokens | 17 in / 4.3k out |
Per-workstream usage
| Workstream | Model | In | Out | Cache read | Cache create | Cost | Duration |
|---|---|---|---|---|---|---|---|
| orchestrator-selection | claude-sonnet-4-6 | 5 | 643 | 34.6k | 54.0k | ~$0.22 (est.) | 20s |
| go:implementation-tests | claude-sonnet-4-6 | 7 | 3.3k | 200.0k | 106.2k | ~$0.51 (est.) | 1m 20s |
| orchestrator-rollup | claude-sonnet-4-6 | 5 | 348 | 55.1k | 42.3k | ~$0.18 (est.) | 18s |
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.
Problem
crlaunches Claude background tasks with--permission-mode acceptEdits. Tool-using reviewers block when they request a read-only Bash command (e.g.git diff), because enabling the Bash tool does not approve its execution. The reviewer stalls until the task timeout (observed on SignalFT/ai-hero#80).Change
--bg):--permission-mode auto.-p): unchanged, keepsacceptEdits.validateArgsenforces the transport-specific invariant and rejects the wrong mode for either transport.auto, foreground assertsacceptEdits, validation rejects both wrong pairings.Deviation from the issue text
#515 also proposed
--enable-auto-mode. That flag was removed in claude CLI v2.1.111 (current CLIs silently tolerate unknown flags, which is why runs including it appeared to work);--permission-mode autois the complete replacement. It is deliberately not passed and not added to the validation allowlist.Verification
go build ./...,go vet ./...cleango test ./...: 2745 passed, 66 packagesgolangci-lint run ./...: no issuesCloses #515