Skip to content

Run Claude background reviewers in auto permission mode #515

Description

@rianjs

Problem

cr launches Claude background tasks with --permission-mode acceptEdits. Tool-using reviewers can become blocked when they request a read-only Bash command, such as git diff, because enabling the Bash tool does not approve its execution.

Observed behavior on SignalFT/ai-hero#80:

  • Claude successfully read the reviewer prompt.
  • The SOLID reviewer requested a read-only git diff.
  • Claude reported the background agent as blocked.
  • No Bash tool result was recorded.
  • cr waited until the task timeout.

Change

For Claude background tasks, invoke Claude with:

claude --bg --enable-auto-mode --permission-mode auto ...

Keep foreground print mode unchanged.

Update the strict subprocess argument validation and existing adapter tests to preserve the transport-specific permission-mode invariant.

Acceptance criteria

  • Claude background launches include --enable-auto-mode.
  • Claude background launches use --permission-mode auto.
  • Claude foreground launches continue using their existing permission mode.
  • Argument validation rejects the wrong permission mode for either transport.
  • Existing Claude adapter tests pass.
  • The empirical check uses Claude background mode, not print mode.
  • SOLID is selected and starts an Opus reviewer.
  • Claude JSONL records the read-only Bash/git diff tool request followed by a non-error tool_result.
  • The Claude reviewer does not end in the blocked state.
  • The reviewer task and orchestrator rollup both complete with status=ok.
  • The full cr review invocation exits successfully in less than 15 minutes.

Empirical check

cr review https://github.com/SignalFT/ai-hero/pull/80 \
  --profile=claude-monit-reviewer \
  --dry-run --rerun --fresh-session --max-agents=1

Successful local validation:

  • Run: e60e1895-e8a4-4e7c-a423-69dca7ad5cea
  • Duration: 4m48s
  • Reviewer: architecture:solid-reviewer-agnostic
  • Result: completed with three findings
  • Focused adapter tests: 127 passed

Out of scope

Fail-fast detection for stale or blocked Claude background jobs. The existing task timeout remains the fallback; any watchdog behavior should be handled separately if required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions