Coding Agent Benchmarks: Retries Reshuffle the Ranking

Does a coding agent benchmark that scores one attempt pick the right model? Not always. Real users say "try again", and a December 2026 Databricks experiment shows that a short retry loop can change which agent comes out on top. To evaluate a model for code work or incident triage, measure the first attempt and the solve rate after a few retries with minimal feedback, and read the transcripts of agents that keep failing.
What Databricks Measured
The Databricks AI Research Team published One attempt isn't enough on December 3, 2026. The setup is simple:
- Up to five attempts. The agent continues "from its previous solution in the same workspace," and evaluation stops when it succeeds or runs out of attempts.
- Almost no feedback. "We tell the agent how many checks passed, but not which ones failed or why."
- Two benchmarks. 97 tasks from SWE-bench-Live, filtered to tasks whose reference patches passed in three independent runs, and Databricks Bench V2, 100 internal tasks built from their own coding agent usage.
- Two agent harnesses. Codex and Claude Code, "powered by frontier models from OpenAI and Anthropic," all at high reasoning effort.
- One metric. The "cumulative solve rate": the share of tasks solved within the first N attempts.
SWE-bench-Live is a good fit for this kind of test. Its site calls it "the first automatically-updating, multi-language and multi-os" task set: new tasks are added over time, which helps against models that saw old answers in training. Databricks still found contamination in some of the newest models and used older versions where it saw none.
How Retries Reshuffle the Ranking
On SWE-bench-Live, the post reports that "Sonnet 5 initially outperforms GPT-6 Sol by nearly 10 percentage points." Over multiple attempts, GPT-6 Sol ultimately overtakes Sonnet 5 by 5 points. The GPT-6 configurations Databricks evaluated solved approximately 55 to 67% more tasks by the fifth attempt than on the first. That is a relative gain over the first-attempt count, not percentage points.
Databricks Bench V2 starts from higher success rates than SWE-bench-Live, and the six agents solve 8 to 23% more tasks by attempt five. GPT-6 Astra starts with a 9 to 11 point lead over Sonnet 5.5 and GPT-6 Sol, but all three converge to 95 to 97% by the fifth attempt. Here, retries do not flip the leader. They erase the gap.
Two lessons follow. A first-attempt leaderboard can name the wrong winner for an iterative workflow. And on an easy, saturated task set, a first-attempt lead may not matter at all once retries are allowed.
This metric is not the classic pass@k. Classic pass@k draws k independent samples and asks whether any of them passed, as our post on repeating LLM evals explains. Here the attempts are sequential, share a workspace, and get feedback. Call it "solve rate by attempt N" in your reports so nobody mixes the two up.
Step 1: Build a Try-Again Loop
You need a task prompt, a check script that prints PASSED TOTAL on its last line, and an agent CLI that can continue a session non-interactively. The Claude Code headless docs show the pattern: --output-format json returns a session_id, and --resume continues that session. --permission-mode acceptEdits comes from the CLI reference.
#!/usr/bin/env bash
# try-again.sh: up to 5 attempts; the only feedback is the passed-check count.
# Usage: ./try-again.sh task.md ./checks.sh (checks.sh prints "PASSED TOTAL")
set -euo pipefail
task=$(cat "$1"); checks=$2; max=5
sid=$(claude -p "$task" --permission-mode acceptEdits --output-format json | jq -r '.session_id')
for attempt in $(seq 1 "$max"); do
git diff > "attempt-$attempt.patch"
read -r passed total < <("$checks" | tail -n 1)
echo "attempt=$attempt passed=$passed total=$total" | tee -a attempts.log
[ "$passed" -eq "$total" ] && exit 0
[ "$attempt" -eq "$max" ] && exit 1
sid=$(claude -p "Not quite right: $passed of $total checks pass. Try again." \
--resume "$sid" --permission-mode acceptEdits --output-format json | jq -r '.session_id')
done
For Codex, the non-interactive mode docs say codex exec runs in a read-only sandbox by default, so allow edits with --sandbox workspace-write, and continue with codex exec resume:
codex exec --sandbox workspace-write "$task"
codex exec resume --last "Not quite right: $passed of $total checks pass. Try again."
A task that is solved on the third attempt leaves this in attempts.log:
attempt=1 passed=7 total=9
attempt=2 passed=8 total=9
attempt=3 passed=9 total=9
Keep the feedback text identical for every model. If one harness gets "test_parse_invalid failed" and another gets a count, you are comparing feedback, not models.
Step 2: Report pass@1 and the Solve Rate by Attempt N
From attempts.log, record for each task the first attempt that passed all checks, or "unsolved". Then report one row per model:
| Model and harness | Attempt 1 | By 2 | By 3 | By 5 | Rank at 1 | Rank at 5 |
|---|---|---|---|---|---|---|
| Model A | 40% | 51% | 56% | 60% | 1 | 2 |
| Model B | 31% | 46% | 55% | 64% | 2 | 1 |
The numbers above are illustrative. They show the shape Databricks saw on SWE-bench-Live: a model that is weaker on the first try but better at using feedback. Report both rank columns. A single headline number hides the crossover.
Also record what each attempt costs. The Claude Code JSON output carries the result, the session ID and metadata per call; keep it. The Databricks post does not report tokens or time per attempt, so you have to measure the price of attempt five yourself.
Step 3: Watch for Agents Doubling Down on a Wrong Hypothesis
Retries help when the agent re-reads the problem. The post says agents "often discover overlooked edge cases or correct any overly broad assumptions." They hurt when the agent digs in: "sometimes agents will simply go deeper into refining the wrong hypothesis and fail to recover." Their example is a format-detection task where the agent spent all five attempts improving how the code recognized CSV files, while the failing check tested how it handled invalid input.
The attempt-N.patch files from the loop make this visible: diff attempt-2.patch attempt-3.patch shows what one retry changed. Flag a run for review when:
- The passed count stays flat for two attempts in a row.
- Every retry edits the same function again, and no new file or code path appears.
- The agent's summary repeats the same root cause in different words.
- The pass count goes down: the agent broke a passing check to chase the failing one.
Count these runs per model. Two models with the same solve rate by attempt five can differ a lot in how many runs ended stuck on one idea.
Step 4: Pick the Number That Matches the Workflow
| Workflow | Rank models by | Why |
|---|---|---|
| Agent opens a PR, CI runs, agent may push again | Solve rate by attempt N, with N = CI rounds you allow | The pass count is what CI already gives the agent |
| Developer chats with the agent and says "try again" | Attempt 1 and by 3 | People rarely retry more than a few times |
| Incident triage, where on-call acts on the first answer | Attempt 1, plus doubling-down rate | A wrong first hypothesis costs time before any retry |
| Unattended action with no checker | Attempt 1 only | There is no feedback signal to retry on |
For triage, the closest thing to a pass count is "the alert is still firing". Test with that signal, not with a hint that names the real cause.
Troubleshooting
jq: erroror an emptysid. The firstclaude -pcall failed or printed text instead of JSON. Check that--output-format jsonis on every call, and run the command once by hand.- Codex resumes the wrong session.
--lastpicks the most recent session in the current directory. Run each task in its own directory and never run two tasks in the same one at once. - Codex attempts change nothing.
codex execis read-only by default. Pass--sandbox workspace-writeon the first call. - Attempt 2 scores like a fresh run. The workspace was reset between attempts. The Databricks method keeps the previous solution in place; reset only between tasks.
- Scores jump on attempt 2 for one model only. Diff the feedback text. A harness that prints test names leaks the answer.
- All models converge near 100%. The task set is too easy for retries to separate models, as on Bench V2. Add harder tasks or compare on attempt 1.
Applying It to SRE Agents
Model choice is the decision an SRE agent team has to defend, and SRE Bench compares models on real production incidents. To test your own candidates, switch the model in Settings → AI models as the getting started guide shows, ask the agent about a known past incident, for example with a Slack mention, and read the run log. Note whether the first hypothesis was right and, if not, whether the agent changed course or doubled down. For agents that grade their own work, see our post on agent acceptance criteria.
Conclusion
One attempt is a useful number, not a benchmark. Run each candidate in a try-again loop with a fixed, minimal feedback message, report attempt 1 next to the solve rate by attempt N, and flag runs that repeat the same wrong fix. Then rank models by the number that matches how your team actually works.
If your team wants AI-assisted incident workflows that you can test before you trust them, Akmatori helps SRE teams investigate alerts, coordinate response, and automate safe infrastructure actions. Powered by Gcore for global infrastructure reliability.
