Green CI, Swallowed Errors: LLM Agents Clear Warnings but Keep the Bug
Abstract
Coding agents are asked to make continuous integration (CI) pass, and many pipelines accept a repair once the static-analysis warning is gone and the build is green. We ask whether a green build means the bug is fixed. We study one trap: a flagged exception handler in a function whose docstring says the exception must propagate. Hidden tests check the documented behavior. In two synthetic-code studies, one registered on OSF and one hash-frozen before testing, agents rarely suppressed warnings on real bugs (at most 1.2%). On these traps, however, they cleared the warning and kept the bug in 22.5-75.0% of cases, usually by narrowing the handler to the exception that must propagate. Plain CI accepted 85.8% of these wrong repairs, and with the exception rules of ruff or pylint, 50.0%. A generic reminder helped one of three agents; a docstring-review turn and a CI check derived from the docstring helped all three. A third study, hash-frozen before testing, used real library and recent GitHub functions and 7 agents, four of them frontier models. Under the original CI, agents left the documented exception swallowed in 9.7-51.5% of traps. The review turn, which also adds tool calls, lowered this for every agent. An executable contract witness in CI lowered it for 4 of the 5 agents tested. On the half of the units with a witness, the rate fell from 12.6-54.8% to 0.0-6.0% (post hoc). A passing build does not test the documented error path; pipelines should test it directly.
Community
A green CI does not necessarily mean a correct repair.
This paper studies how LLM coding agents can remove lint warnings and pass visible tests while silently violating documented program behavior.
We introduce executable contract witnesses to evaluate whether code repairs preserve documented requirements, rather than merely satisfying surface-level CI checks.
I winced at this one: narrowing the handler to exactly the exception that was supposed to propagate probably looks like good practice in review. With the contract witness in CI, what did agents do in the few remaining wrong repairs: miss the documented path, or find a way around the check?
We also did more experiments in next version of this article:
We have since broken down the 15 remaining failures on units with a witness: 10 ended with the witness still failing (the agent stopped without passing it), 5 passed the witness but failed a held-out input, and none edited the docstring, the witness or CI. So: missed the documented path, not a way around the check. This breakdown will be in the next version.
Thanks, that is exactly the trap: narrowing to the exception the code raises is the linter's textbook fix, so it reads as a careful repair in review.
On your question, the v1 data (Study 3, Section 5.6) point mostly to "no witness" rather than "a way around it":
- Coverage is the main gap. The generator built a usable witness for only 169 of 335 units (50.4%). On those units, silenced-not-fixed under the witness CI fell to 0.0โ6.0% for every agent, from 12.6โ54.8% under the original CI. That is partly by construction, since the witness is a failing test of the documented exception. Most remaining wrong repairs sit on units without a witness, where the CI ran only a placeholder test.
- That placeholder was not neutral, which we did not expect. On uncovered units the rate rose for 5 of 7 agents, for example GPT-6.1-sol from 17.2% to 30.1%. We cannot explain it from the frozen data.
- Little sign of gaming the tests. All 78 episodes the frozen rule classed as "tampering" ran under the review turn, not the witness CI. Each edited only the visible test file and passed the hidden tests; in the cases we read, the agent had added tests of the documented behavior.
- One real workaround: rewriting the contract. In 68 of 9,713 frontier-agent episodes (0.7%), the agent deleted the documented exception from the docstring, 14 of them under the witness CI. Almost all were GPT-6.1-terra and -sol. In the cases we read, the agent kept the swallowing handler and changed the docstring to promise a None return. This is why we recommend reading the contract from the base commit, not from the agent's edited version.
Get this paper in your agent:
hf papers read 2612.02421 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper