Skip to content

ci: let the Claude review fan out, and make an unfinished review visible - #1439

Merged
cbcoutinho merged 1 commit into
masterfrom
fix/claude-review-allow-task
Sep 5, 2026
Merged

ci: let the Claude review fan out, and make an unfinished review visible#1439
cbcoutinho merged 1 commit into
masterfrom
fix/claude-review-allow-task

Conversation

@cbcoutinho

Copy link
Copy Markdown
Owner

Based on master, independent of stack #1438, so it can merge first — the other
two PRs then rebase onto it and get a review that can actually complete.

The bug

The claude-review allowlist had no Task, so on a large diff the reviewer
fails silently.

On #1437 (~3800 lines across 6 files) it announced "Dispatched parallel
sub-reviews of the three logical chunks"
, had all 12 of those calls denied
(permission_denials_count: 12), then exited is_error: false after 17 turns —
leaving the sticky comment reading:

### Review in progress
- [x] Gather context
- [ ] Review server/cookbook.py refactor
- [ ] Review server/semantic.py extraction
- [ ] ...
- [ ] Post final review

Dispatched parallel sub-reviews … Will compile findings once they land.

…and no findings, ever.

The check went SUCCESS regardless, because it reports that the action
ran, not that a review happened. So the PR presented as reviewed-and-clean
while nothing had been reviewed. Two runs failed identically ~2 minutes apart
(2m20s and 1m49s), so it is not a flake.

Smaller diffs are unaffected: #1433 reviewed fine because it never chose to fan
out. That is what makes this nasty — it only bites the PRs most in need of
review, and it looks like success.

The fix

1. Allow Task. The reviewer already tries to fan out on large diffs; this
lets it. Effective allowlist was Glob, Grep, LS, Read, mcp__github_comment__update_claude_comment, Bash(git …) plus the workflow's gh
commands — no Task.

2. Tell it to report an unfinished review. Its system prompt already asks it
to explain missing permissions ("so that the user can update your
--allowedTools
") and it did not. The prompt now says explicitly: if you cannot
finish, name what blocked you in the tracking comment, and do not leave an
unticked "Review in progress" checklist.

That second change is the more general one. Task fixes this instance; a green
check over a half-written comment is the failure class, and the next cause
won't be permissions.

Cost — worth a conscious decision

Fan-out means several sub-agents per review. The single non-fanned-out run on
#1437 cost ~$1, so budget a multiple of that on large diffs. Recorded in an
inline comment next to the setting, with the fallback stated: drop Task again
if it proves too expensive, accepting that large PRs then need splitting to be
reviewable at all.

Verification

  • YAML parses; claude_args and the on.pull_request.types: [opened, synchronize] triggers confirmed unchanged via yq.
  • No application code touched — workflow only.
  • The real proof is behavioural: once merged and the stack is rebased, refactor(server): clear the 5 SonarCloud cognitive-complexity findings #1437's
    review should complete instead of stalling. Worth watching that specific PR
    rather than assuming.

Follow-up

reopened is not in the trigger types, which is why closing/reopening a PR
re-runs Tests but not the review. Not changed here — adding it would re-run a
billed review on every reopen. Noting it because it cost me a confusing round.


This PR was generated with the help of AI, and reviewed by a Human

🤖 Generated with Claude Code

https://claude.ai/code/session_019iCzZAuCMsZS7UJYfy3htd

The claude-review action's allowlist had no `Task`, so on a large diff the
reviewer fails silently. On #1437 (~3800 lines across 6 files) it announced
"dispatched parallel sub-reviews of the three logical chunks", had all 12 of
those calls denied, then exited with is_error: false and 17 turns — leaving a
sticky comment that still read "Review in progress" with an unticked checklist
and no findings.

The check went SUCCESS regardless, because it reports that the action ran, not
that a review happened. So the PR presented as reviewed-and-clean when nothing
had been reviewed. Two runs failed identically, ~2 minutes apart; it is not a
flake. Smaller diffs are unaffected — #1433 reviewed fine because it never
chose to fan out.

Two changes:

- Allow `Task`, so the fan-out the reviewer already attempts can actually run.
- Tell it, in the prompt, to say so in the tracking comment when it cannot
  finish. Its system prompt already asks it to report missing permissions and it
  did not, and a silent stall is the expensive failure here: a green check over a
  half-written comment is worse than a red one.

Cost note recorded inline: fan-out means several sub-agents per review, and a
single non-fanned-out run on that PR cost ~$1. Drop `Task` again if that proves
too expensive, accepting that large PRs then need splitting to be reviewable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019iCzZAuCMsZS7UJYfy3htd
@cbcoutinho
cbcoutinho merged commit f7ff98f into master Sep 5, 2026
5 checks passed
@sonarqubecloud

sonarqubecloud Bot commented Sep 5, 2026

Copy link
Copy Markdown

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.

1 participant