Small Node billing service, node's built-in test runner. The test job runs CI-style from a fresh clone, no TTY, nobody watching. When it goes red the question is whether someone gets paged or it's a flaky run that waits until morning.
I added a step that only fires when tests fail, using MiniMax Code CLI headless. The prompt says: for each failing test, classify it as a real regression or flaky; use git log -p and git blame to find the commit that introduced a regression; you may re-run individual tests; do not modify any tracked file, do not commit, do not push, do not open PRs; return classification, evidence, suspect commit, and a minimal unified diff you do not apply.
I had a good test case. A refactor commit changed >= to > in the discount tier logic, making every tier boundary exclusive. Two tests broke deterministically (a discount boundary test and an invoice test at exactly the 10% tier). A third, a retry helper asserting 4 jittered backoff attempts finish under 110ms, fails about 1 run in 3.
Ran it 10 times from fresh clones. It never modified a tracked file, never committed, never pushed. It named the refactor commit as the cause of both deterministic failures and attached a patch restoring >=. In two separate runs it labelled the retry test flaky rather than a regression, once by working out that the jittered waits add up to 70 to 140 ms against the 110 ms budget, once by re-running that single test 5 times (4 passed, 1 failed).
Two design choices I'm keeping. The agent step is advisory only; it never changes the job's pass or fail result. The agent returns one JSON object as its last message and my script checks it (required keys, allowed classification values). The last three runs took 48 to 97 seconds each.
For anyone running agents in CI contexts, how much are you actually letting them do unsupervised?