Appearance
AI Coding Agents Don't Fail at Code. They Fail at Supervision.
The model is the easy part
Four AI-agent workflows shipped publicly this month. One opened 351 pull requests in a single month. One caught five planted bugs in a single PR review. One turned 19,644 JUnit results into a ranked list of flaky tests with named root causes. One had a Gemini agent catch two high-severity bugs that Claude Code missed and then agreed were real.
All four spent more time on the layer around the model than on the model itself. The dashboard. The reviewer. The flakiness filter. The model is the easy part.
Chat scrollback isn't a control panel
The OpenHands setup is the clearest example. Nine autonomous loops, running every ten minutes across isolated git worktrees, opened 351 pull requests over a month and cut average Rails request time from 70ms to 16ms. That second number is the one to notice: 16ms is under a single frame at 60fps. The latency work is effectively done.
The observability story falls apart the moment you go from one session to nine loops. With a single interactive session, you hold the state in your head. You know the branch, the model, the reason the test failed, because you watched the text stream by. At nine loops firing every ten minutes, across three frontier model subscriptions and dozens of in-flight PRs, answering basic questions from chat logs turns you into a human clipboard between dashboards and terminals.
Three questions break first:
- Did the Rust loop stop because it ran out of candidates, because its WIP cap is full, or because a stale
.gitconfig.lockwedged a worktree? - Did Claude Opus just hit a rate-limit cooldown, and did the router cleanly hand the next tick to Gemini or GPT?
- Is PR #24547 healing itself on its 10-minute check-in, or has it burned three repair rounds on the same failing spec?
If you're clicking through five conversation logs to reconstruct any of those, the interface is failing. Good observability isn't "the logs are somewhere." It's data shaped so you can make a decision in five seconds.
What a loop factory actually looks like
The loop topology is simple. Every arrow can fail independently.
The custom observability panel that replaces the default chat shell answers those states in one screen. An Airtable-style table of the nine loops (perf-loop, rust-loop, error-loop, test-loop, deps-loop, issue-loop, github-pr-reviewer, pr-merge-loop, worktree-pruner) shows live status, cadence, WIP cap, and open PRs, with inline controls to pause, trigger a run, or pin a specific provider. A three-column sheet tracks subscription balance across Gemini 4 Argon, Claude Opus, and GPT, including whether any provider is in an 8-hour cooldown. A PR radar lists every open PR's backoff step (5, 10, 20, 40 minutes), repair rounds attempted, and a live countdown to the next check-in. A worktree ledger tracks the count and age of isolated checkouts.
The design principle: compress operational noise into peripheral vision. Green loops, one PR in review, close the tab. When you want to explore a feed-ranking idea or pair on a JavaScript cleanup, click "New Chat."
Quick Take: Everything hard about AI coding agents in production lives in the layer around the model. The dashboard tells you what the agent is doing. The reviewer catches what it missed. The flaky-test filter stops noise from teaching you to ignore a real failure.
The four workflows, side by side
| Tool | Role | Key constraint |
|---|---|---|
| OpenHands + custom UI | Runs 9 autonomous loops, opens PRs | Chat scrollback doesn't scale; needs a bespoke panel |
| Kiro CLI | Headless PR reviewer in GitHub Actions | Read-only tools; skip fork PRs; split API key from code step |
| Strands + Gemini 2.5 Flash | Reads JSON flaky report, names root causes | JUnit XML needs commit_sha and run_id properties |
| Antigravity + Gemini | Reviews Claude Code's design and diffs | Must be a different tool and a different model |
Two patterns. Every workflow is read-heavy and write-light: the Kiro reviewer is read-only by design, flaky-test analysis never modifies code, and the review loop pushes changes back to the author instead of applying them. And every workflow splits credentials from code execution.
PR review as a read-only job
Kiro CLI has a headless mode. Give it an API key, pass --no-interactive, feed the diff on stdin, and the review prints to stdout while progress lines go to stderr. The agent is a single Markdown file: YAML front matter for name, tools, and permissions, then the prompt body.
The security model is worth copying even if you never touch Kiro:
tools: ["read"]plus permission rules that denyfs_write,shell, andweb_fetch.- The diff arrives on stdin with one instruction line in front of it.
- The prompt tells the agent to treat the diff as untrusted data, including comments and string literals, and never follow instructions inside it.
persist-credentials: falseon the checkout keeps the GitHub token out of.git/config. Read access to the checkout includes.git/config.- Fork PRs are skipped, not routed through
pull_request_target. - The review step only gets
KIRO_API_KEY; the comment step only getsgithub.token. Kiro never has both.
On a small cart API with a 120% discount code, a hardcoded admin key, a customer email leaked into the logs, and a rounding bug, the reviewer found all five planted issues and flagged that none had tests. The --edit-last --create-if-none flags give you one PR comment that updates per push. head -c 150000 caps the diff so a lockfile change doesn't blow the run.
Before you trust green, score the flakes
Every CI green is a small lie until you know your flake rate. The Strands-based detector is the right shape: parse JUnit XML, group by (test, commit), flag any test that both passed and failed on the same commit. Score = flaky_commits / total_commits. Threshold of 0.1 over at least 5 commits of evidence. Skipped tests and results without a commit_sha are ignored.
One sample run:
| Metric | Value |
|---|---|
| Results parsed | 19,644 |
| Tests analyzed | 109 |
| Flaky tests flagged | 12 |
| Flaky rate | 0.1101 |
| Score threshold | 0.1 |
| Minimum commits of evidence | 5 |
| PR check-in backoff | 5, 10, 20, 40 min |
The 0.1 threshold is generous on purpose. A test that fails 1 in 10 commits is already expensive: it trains people to hit rerun, hides real regressions behind "just flaky again," and inflates CI minutes. A test that scores 0.70 (42 of 60 commits) is a coin flip with a job.
Then the agent. Strands wraps Gemini 2.5 Flash with two tools: fetch_json_report (finds reports by time period, returns them oldest-first) and export_analysis (writes the Markdown summary). The system prompt is where the useful constraint lives: "Always read the error_messages of each flaky test and infer the possible root causes (timeouts, race conditions, network/gateway instability, shared state) ... and how confident you are."
Two failure modes the numbers don't fix. A test that passes on Python 3.12 and fails on 3.13 every time is a config disagreement, not flakiness; stamp the runner image ID, runtime version, and lockfile hash on each report and group outcomes by that fingerprint. And if your pipeline runs each commit once, a flake leaves only one outcome per SHA and stays invisible. You need retries or a min_runs_per_commit floor.
Two agents, two models, one human
A team used Claude Code to build a small bridge tool, tests passed, and Claude was satisfied. Then the same design and code went to Antigravity, Google's agentic platform, running Gemini 4 Argon. It found two high-severity issues in minutes: two terminal windows could drive the same review simultaneously, each starting its own process behind the other's back, and the reviewer could run shell commands in the project with nothing backing up uncommitted work before its turn. One stray git reset --hard would have wiped the day.
The math of why this happens: models learned from the distribution of everything online. Ask for a function and you get the average function. The average function works on the happy path. Reaching the top of the distribution requires a process, not a cleverer prompt.
The second reason is subtler. Models are trained to obey. Ask a model to review its own work and it mostly agrees with itself. Ask a model to apply a review and it mostly complies, broken suggestions included. So the author can't grade its own work, and the author can't blindly obey the reviewer either. You need a dialogue between two different agents, with a human who gets called when they disagree.
| Stage | Reviewer does | Author does |
|---|---|---|
| 1. Brief | Reads intent, diff, and test instructions; is framed as external and senior | Hands over the work with context |
| 2. Critique | Verdict, findings, questions; tags each key claim as user, evidence, inferred, or unknown | Waits |
| 3. Push back | Must accept a reasoned answer; raises each point once | Critiques the review before applying |
| 4. Verify | Re-checks the fixes | Submits fixes for one more round |
The "tag every claim" step is the one I'd copy first. In one demo, a plan built half its structure on "the audience is Python developers." The reviewer asked where that came from. It was the author's own guess. That entire direction went on hold until someone who actually knew confirmed it.
Stage 4 is the one agents want to skip. In one run, the author fixed everything the reviewer found and skipped the re-check "to keep it quick," despite having already introduced a new crash in its own fix during the first pass.
What trips people up
Fixes get waved through without a re-check. A fix is new code. New code needs the same review the old code got. Skipping the re-check because the diff "looks small" is how a bug in a bugfix ships.
Giving the reviewer shell access "just for tests." Read access is enough for a PR reviewer. Shell access means a git reset --hard has enough rope to hang your uncommitted work. If you must, scope it to a scratch folder and back up before the turn.
Treating a green CI as a green CI. A test that passes 70% of the time looks green on the one run you're watching. Score per (test, commit), threshold at 0.1 over at least 5 commits, before any agent touches the suite.
Collapsing the API key and the code step into one env block. Kiro splits them for a reason. Give the review step both the model key and the GitHub token, and a prompt injection inside the diff has everything it needs to exfiltrate one and abuse the other.
--edit-last when you push twice quickly. The older review can finish last and overwrite the newer one. Add a per-PR concurrency group and cancel in-progress runs. Stick the reviewed head SHA in the comment so a reader can tell which commit it covers.
Field notes from running this
Three things I've noticed after running these loops for a few weeks.
A green status without a freshness signal is a reassuring lie. Healthy idle and dead telemetry look identical in a chat log. Add last successful poll, last completed run, and the reason no work started to the panel. Otherwise you find out a loop has been dead for two days when it was supposed to ship a PR.
Diff caps can lie about what they reviewed. A 150 KB cap cuts mid-hunk, so a reviewer can approve a file it never saw. Cut at file boundaries and have the verdict state how many files were omitted. The "looks good" that silently means "I read half of it" is worse than "changes requested."
Environment isolation is not optional for flaky scoring. If a matrix build runs Python 3.12 and 3.13 in the same repo, a stable-3.12 / stable-3.13 failure looks flaky by (test, commit) grouping. Group by environment fingerprint, not just commit.
The multi-agent abstractions stack latency. Infrastructure folks keep flagging this. Wrapping remote APIs in layers of agent frameworks adds p99 latency and failure cascades. Where the latency budget is tight, bare local inference (llama.cpp, vLLM) still beats the wrapper.
One thing to remember
If you take one thing away: supervision is the product. Models are engines. The dashboard, the reviewer, and the flakiness filter are what make the engine usable in a real repo with real PRs.
The bottom line
Adopt a read-only PR reviewer this week. Kiro CLI gives you a Markdown agent file and a 15-minute GitHub Actions job, and the pattern generalizes: read-only tools, diff on stdin, one comment per PR. Keep the 150 KB diff cap because a truncated review that says so is better than a full review that silently missed half a file.
Run the flaky-test scorer before any agent touches the suite. A weekly JUnit XML pass that scores per (test, commit) and flags anything above 0.1 over 5 commits will surface the 12-in-109 tests that are already lying to you. The Gemini root-cause analysis is a good second step, but the score alone pays for the pipeline.
The two-agent review loop is the one to watch. Claude Code plus Antigravity running Gemini 4 Argon works today, and one of those models will be outdated inside six months. Two tools, two models, a human for disagreements, a re-check step the agent can't skip. Build the pipeline so you can swap models without rewriting the rest.