r/ChatGPTCoding • u/bisonbear2 • 28m ago
Resources And Tips Evaluating coding agents from merged PRs: leaks, picky tests, and noise
Spinning up a coding agent eval on your own repo takes an afternoon. Google AI overview even does a pretty good job of explaining how to do it!
Coding agent evals are an 80/20 problem - getting the first 80% takes 20% of the effort and feels really great. Making it trustworthy takes the remaining 80%.
Most of the numbers below come from an early benchmark I built on Click (29 merged PRs), comparing a cheap, fast setup (GPT-6 Luna at low effort, $0.27 total) against a frontier setup (GPT-6.1 Sol at high effort, $4.38 total).
Here are 5 areas of unexpected complexity I ran into buliding it:
I'm building Stet to turn a team's real work into a private living benchmark, allocate agent spend efficiently, and raise the engineering quality floor with evidence. If you're weighing a change on your repo (switching to a cheaper model, tuning reasoning effort, editing AGENTS.md, or evaluating whether skills are helpful) and want to measure it on your own tasks, reach out!
Evals are world simulation
An eval is a simulation of reality built to help you make a decision. To get a high quality signal, the tasks, prompts, and environments need to look like the work you actually hand to agents.
If I tell the model to
Implement function `parse_pkg_version(name)` in `src/click/decorators.py` using `importlib.metadata.version()`, catching `PackageNotFoundError` and falling back to `__version__`. Add unit tests in `tests/test_options.py` covering missing distributions, mismatched import names, and empty strings.
most models, from Haiku to Fable, will probably nail it. In this world, the agent is implementing a specification.
Instead, if I ask the agent to
hey big dawg, `--version` is broken when a package's import name doesn't match its pip name. can u fix?
the agent is determining user intent, researching a bug, figuring out how to fix it, and implementing the fix, which is far closer to how engineers use agents day-to-day.
This creates a tightrope between specifying the interface contract and leaking the implementation. If the hidden tests we use for grading import a specific public function name foo or specific exported constants, these constraints must be named in the prompt, or an otherwise good solution will fail for trivial reasons. At the same time, if you over specify, and describe how to wire them up, the task can become trivially easy for agents to solve.
Our approach is for public APIs/constants, name them naturally in the initial prompt. We don't expose private names, and if a hidden test calls a private helper, we move the test to a public entry point instead of turning the prompt back into a spec that names everything to implement.
Mining PRs naturally biases toward easy to isolate changes. When we audited our 29 Click tasks, 22 were small changes and none touched 150 lines of production code (we have since updated the task pipeline to choose harder tasks, but this illustrates the difficulty in doing so).
Environments leak and fail silently
Agents yearn to cheat. It's your responsibility to stop them.
What makes cheating a quagmire and not just a 5 line Dockerfile fix is how it warps your results. First, cheating looks like the agent is doing great! On one task I audited, a contaminated run graded "identical to the human patch". Second, cheating scales with reasoning effort. Higher effort / more persistent agents search harder (checking git reflogs, tags, remote PRs, or closed issues), so leakage doesn't lift every model evenly. It silently manufactures a win for higher effort configs that "make sense" to be winners.
To block this, you must set up the environment as it would have been at the start of the task: cut off git history and refs after the parent commit, snapshot Jira/Linear to the same cutoff if agents have access, preinstall deps in setup, run the agent behind a provider-only relay (blocking web/PR/commit lookups while letting model traffic through), and finally audit tool traces after the fact to find cheating.
Historically, roughly a third of our candidate attempts failed on infrastructure or setup rather than the agent itself (we are driving this down). If your grading instrument scores an empty or timed out run as 0, an infra failure looks identical to a model failure.
In practice, you need to snapshot and reuse verified environments (reusing 2 Click snapshots across 29 tasks cut median verification time from ~15 minutes to ~20 seconds) and classify every non-pass so infra and quota losses get rerun (and fixed) instead of being scored as failures by the agent.
Testing is hard
Tests can be wrong in both directions. On our 29 Click PRs, we found 7 runs where the held-out tests failed an agent's patch even though our LLM reviewers passed it. Three turned out to be real regressions the reviewers missed (like --help exiting with code 2). The other four failures were the result of overly picky tests pinning unstated details, such as exact error wording.
When we asked an automated LLM reviewer to screen those Click tasks for bad tests, it flagged 17 of the 18 tasks another blind audit confirmed were completely fair, while missing half the real test defects.
Because static LLM review can't reliably separate a picky test from a real behavioral assertion, we verify tests by execution. Prove that every test fails on the parent commit and passes on the merged patch, and when a reasonable patch disagrees with a test, run a quick behavioral check against both the human patch and the agent patch outside the test suite before blaming or relaxing the test.
Static diff review isn't execution
On a Click PR, both models wrote the exact same bracket bug, turning [a|b]! into [[a|b]!]. At low reasoning effort, our equivalence judge called the broken patch equivalent to the human PR in 3 of 4 draws at 0.99 confidence. At medium effort it was still wrong at 0.98. Only high reasoning effort caught the bug.
Tightening the prompt doesn't automatically fix it either. Across 14 Click patches we knew by execution were broken, a requirement checklist judge still marked 5 as meeting every essential requirement (and 3 of those 5 had also passed the hidden unit tests). When we tightened the prompt to force tracing edge cases and compatibility paths, false passes went up from 5 of 14 to 6 of 14.
The takeaway here is to not trust judges by themselves. Treat the judge (model, prompt, and reasoning effort) as a measurement instrument, calibrate its error rate, and deploy it according to its measured performance, not its self-reported confidence.
Your scoreboard invents winners
On our 29 Click PRs looking at tests alone, 22 tasks told us nothing about which model was better (13 both passed, 5 both failed, 4 unresolved). The entire 29-task benchmark came down to 7 deciding tasks, which the frontier setup won 7–0.
Worse, small samples actively hallucinate winners out of run-to-run noise. Before comparing two setups, compare one setup against itself (an A/A test). When we ran the exact same configuration twice across 24 tasks, checking results partway through at 16 tasks reported an 89.8% probability that one identical run was better than the other. Across simulations, false-winner rates ran 11.3% at 5 tasks and still sat at 6.1% at 24 tasks.
Finally, collapsing cost and quality into a single ratio ("cost per successful task") rewards the model that gives up fastest. On our 24 task benchmark on our own repo, the cheap Luna low setup ranked #1 on cost per success ($0.26) while losing 0–13 head-to-head, because on hard multi-file tasks it quit in under four minutes for a few cents.
Conclusion
Synthesizing learnings from above, here's a checklist you can use going forward to raise the quality of coding agent evals you make:
- Ensure tasks are representative and fair.
- Compare task size/type to the changes you actually make.
- Specify the interface contract hidden tests import without leaking the implementation.
- Snapshot envs and block history.
- Reuse verified environments so observation stays fast.
- Catch and rerun infra/quota losses instead of scoring
0. - Aggressively block git/web/ticket lookups of the answer and audit traces.
- Verify tests by execution.
- Prove tests fail on parent and pass with the solution.
- Run behavioral checks outside the suite before relaxing a disputed test; use LLMs in tandem with execution, not as a replacement.
- Calibrate LLM judges.
- Pin judge model, prompt, and reasoning effort across every arm you compare.
- Don't trust judges' self-stated confidence - calibrate against execution-verified bad patches and factor that error rate into your decision.
- Pair results, run A/A, and extract calibrated signal.
- Count head-to-head wins per task on disagreements, and keep cost separate from quality.
- Run A/A tests to know your noise floor, and only add finer-grained grading dimensions whose accuracy you've measured.
Running the coding agents is the cheapest and easiest part: on the 29 Click PRs, running both models e2e cost $4.65 total ($0.27 + $4.38). Everything else (building clean tasks, maintaining sandbox snapshots, verifying disputed tests by execution, calibrating judges on known-bad patches, and running A/A checks) costs an order of magnitude more time, money, and engineering discipline.