Skip to content

fix(llm): run Claude background reviewers in auto permission mode#516

Merged
rianjs merged 2 commits into
mainfrom
issue-515-bg-auto-permission
Jul 17, 2026
Merged

fix(llm): run Claude background reviewers in auto permission mode#516
rianjs merged 2 commits into
mainfrom
issue-515-bg-auto-permission

Conversation

@rianjs

@rianjs rianjs commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Problem

cr launches 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

  • Background transport (--bg): --permission-mode auto.
  • Foreground print mode (-p): unchanged, keeps acceptEdits.
  • validateArgs enforces the transport-specific invariant and rejects the wrong mode for either transport.
  • Tests updated: background asserts auto, foreground asserts acceptEdits, 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 auto is the complete replacement. It is deliberately not passed and not added to the validation allowlist.

Verification

  • go build ./..., go vet ./... clean
  • go test ./...: 2745 passed, 66 packages
  • golangci-lint run ./...: no issues
  • Empirical check with a local build to follow on this PR

Closes #515

rianjs added 2 commits July 17, 2026 07:27
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

@rianjs-bot rianjs-bot 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.

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

@rianjs
rianjs merged commit 32e9760 into main Jul 17, 2026
10 checks passed
@rianjs
rianjs deleted the issue-515-bg-auto-permission branch July 17, 2026 13:13
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.

Run Claude background reviewers in auto permission mode

1 participant