Orchestrating AI code review at scale
TL;DR Highlight
Splitting review into up to seven specialist agents plus a coordinator handled tens of thousands of merge requests.
Who Should Read
A platform or backend developer whose AI code review in CI is too noisy and who is rethinking its structure
Core Mechanics
- One big prompt just made noise
- Dropping a git diff into a half-baked prompt produced a flood of vague suggestions.
- It hallucinated syntax errors and told them to add error handling where it already existed.
- Up to seven specialist reviewers
- Reviewers cover security, performance, code quality, documentation, release management, and the internal Engineering Codex.
- A coordinator agent deduplicates findings, judges severity, and posts one review comment.
- OpenCode runs as a server
- OpenCode is server-first, so sessions can be created and prompted programmatically through its SDK.
- The coordinator calls a spawn_reviewers tool that launches each sub-reviewer in its own session.
- Prompts go in via stdin
- Passing a huge MR description as a command-line argument hits the Linux ARG_MAX limit.
- E2BIG errors hit a small share of CI jobs on very large MRs, so they moved to stdin.
- Logs stream as JSONL
- JSONL (one self-contained JSON object per line) stays readable even if the process dies midway.
- A step_finish with reason length means max_tokens truncation, which triggers an automatic retry.
- A 30-second heartbeat stopped cancellations
- Models like Claude Opus 4.7 or GPT-5.4 think long enough that jobs looked hung.
- Printing 'Model is thinking... (Ns since last output)' every 30 seconds almost eliminated the problem.
- Plugins decouple everything
- The ReviewPlugin interface has bootstrap (concurrent, non-fatal), configure (sequential, fatal), and postConfigure phases.
- The GitLab plugin knows nothing about AI Gateway, and the Cloudflare plugin knows nothing about GitLab tokens.
Community Reactions
- Trivial reviews may not be worth the cost
- A commenter calculated about 25,000 trivial runs at 20 cents each, roughly $5k.
- They argued a junior engineer could review these in 30-60 seconds and gain knowledge, which the post ignores.
- Run it locally as a pre-commit or pre-push hook
- Commenters argued a nondeterministic system clashes with the purpose of CI.
- They said running before the MR is opened gives faster feedback and less noise.
- AI review works better as self-review before the PR
- Commenters reported poor signal-to-noise that burdened the team at review time.
- They settled on authors running AI review first and fixing everything before the PR.
- Whole-codebase review costs more
- One commenter built an internal tool on codex exec and Git worktrees that traces dependencies beyond the diff.
- They reported it is noticeably more expensive to run.
- Just use the strongest model
- One commenter's simple Copilot and GitHub Actions version worked well and the team loves it.
- They argued the ROI justifies Opus or GPT 5.5 for less complexity.
How to Apply
- Split your review prompt by domain
- Today, split one review prompt into security, performance, and quality prompts and run them on the same diff.
- Add a merge prompt that dedupes findings and judges severity.
- Pass big prompts via stdin or files
- If you spawn a CLI agent as a child process, send the MR description through stdin, not an argument.
- Write shared context to a file and let sub-agents read it.
- Add a heartbeat log to long model calls
- Print elapsed time every 30 seconds in CI jobs where model calls run long.
- This reduces users cancelling jobs they think are hung.
- Detect truncation and errors as events
- Receive agent output as JSONL and parse it line by line.
- Hook retry logic to finish events with reason length and to error events.
Try It
# Paste into Claude or ChatGPT (simplified version of the article's method: split reviewers + coordinator in one go)
Review the diff below. First, write findings independently as each of these 3 specialist reviewers.
1) Security reviewer 2) Performance reviewer 3) Code quality reviewer
Each reviewer looks only at their domain, reports only certain problems, and cites file and line.
Do not flag error handling that already exists or syntax errors that do not exist.
Then, as the coordinator, merge the three results, remove duplicates, and rate each item's severity (critical/warning/nit).
End with one verdict: approve / needs changes / block merge.
{{diff}}Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques