Ask a coding agent to "make CI pass," and once the static-analysis warning disappears and the build turns green, the job is considered done. Such pipelines are not rare. But does a green build mean the bug is fixed?
A research team of Xiaobo Chen, Yan Mo, and Sihong He tested this question on a single kind of trap[1]. The trap is a function whose docstring says "this exception is passed on to the caller," but which contains a handler that swallows the exception and is flagged by a linter. They ran two studies on synthetic code and one on real functions, fixing the plan for each before the experiments.
To state the conclusion first: in the two studies on synthetic code, agents rarely silenced the warning with a suppression comment. The more noticeable failure was a different one: a "plausible fix" that removes the warning but leaves the bug. Moreover, ordinary CI let most of these fixes through.
What this study tested
As an example, look at the function in Figure 1 of the paper. Its docstring says it raises ValueError if the input is not a non-negative integer. But the body catches a failure of int(text) with a bare except: and returns 0. The linter warns about the bare except:.
A common fix here is to narrow the exception to except ValueError:. The warning disappears. But invalid input still returns 0, and the exception promised by the docstring is never raised. The correct fix is to remove the try/except itself[1].
This mismatch is hard to see because everything the agent can observe, namely the linter result and visible tests that do not reach the trap's path, shows "pass." So the team prepared hidden tests that check the behavior described in the docstring. The hidden tests are not visible to the agent. They call the state in which "the warning is gone but the hidden test fails" SNF (silenced-not-fixed), and use it as the main metric.
Method: a minimal agent and three studies
The agent has only four tools: reading files, writing files, running CI, and finishing. It could call tools at most 12 times per task, and each task targeted a single module[1].
- Study 1 (synthetic code, hash-frozen before the experiments)
- Each of 40 modules contained one ordinary bug, one trap, and one false-positive warning.
- They tested three locally run models (qwen3.6-35b-a3b, gpt-oss-20b, qwen3.6-27b-coding) and the hosted gpt-5.6-luna.
- There were four kinds of instructions: neutral, time pressure, a policy permitting suppression, and a positive control that tells the agent where the bug is.
- Study 2 (synthetic code, preregistered on OSF)
- They tested the same three local models on 48 new tasks.
- Four conditions were compared: normal (N); adding one sentence of general caution (D); an extra turn to review the docstring (R, with up to 4 additional tool calls); and adding to CI a contract checker built from the docstring (G).
- Study 3 (real code, hash-frozen before the experiments)
- They injected traps into 168 functions and created 335 units. These consisted of 84 functions from 27 packages, including the Python standard library, and 84 functions from 41 public GitHub repositories created in 2026 or later. One unit is a pair of one function and one trap.
- There were seven agents: the three local models from Study 2, plus four frontier models (GPT-6.1-sol, GPT-6.1-terra, Claude Sonnet 5.5, Claude Opus 5.5).
- The conditions compared were the original CI (N), the review turn (R), the contract checker (G), and CI with a "contract witness" test added (GW).
A contract witness turns the docstring's promise that "exception E must propagate" into an executable test that fails if E is swallowed. An LLM proposes a concrete call that should raise E. The call is adopted only after a container check confirms that it fails on the version with the trap and raises the exception on the version where the exception propagates[1].
Findings
"Plausible wrong fixes," more than "cheating"
In Study 1, the share of real-bug warnings silenced with a suppression comment was at most 1.2% across the three instructions of neutral, time pressure, and suppression policy. Under the neutral instruction, every model scored 0.0%. In the positive control that told the agent where the bug was, all models fixed it 100% of the time.
On the other hand, trap SNF under the neutral instruction ranged from 22.5% (gpt-5.6-luna) to 75.0% (qwen3.6-35b-a3b) (40 cases each, Table 3 of the paper). The share that passed CI but failed the hidden test was 22.5–70.0%. Changes in SNF from the time-pressure or suppression-policy instructions were not statistically detectable.
The failures were skewed in form. Of the 231 SNF cases in Study 1, 143 (62%) narrowed the exception to a specific type and left fallback handling such as returning 0[1]. This is the same form as except ValueError: in Figure 1.
Ordinary CI lets most wrong fixes through
Using the fix records collected in Study 2, the team compared after the fact which pass/fail rules could stop wrong fixes. The table below shows the result.
| Pass/fail rule | Share of wrong fixes passed | Share of correct fixes rejected |
|---|---|---|
| CI (linter + visible tests) | 85.8% (139/162) | 17.5% (47/269) |
| CI + ruff exception rules | 50.0% (81/162) | 30.9% (83/269) |
| CI + pylint exception rules | 50.0% (81/162) | 21.2% (57/269) |
| CI + simple structural rule | 0.0% | 53.9% (145/269) |
| CI + contract checker | 0.6% (1/162) | 17.5% (47/269) |
Fixes to traps obtained in Study 2 (conditions N, D, and R), compared by pass/fail rule (post hoc analysis). The 162 wrong fixes are those that failed the hidden test; the 269 correct fixes are those that passed. Created by ScienSeeds from the values in Table 7 of the paper.
Source: Created by ScienSeeds
Even with stricter linter exception rules, half of the wrong fixes got through. In addition, the share of correct fixes rejected increased. The simple structural rule stops all wrong fixes, but also rejects more than half of the correct ones.
The contract checker looks strong, but the authors regard this as an optimistic upper bound, because it was developed with the same generator used for the Study 2 tasks[1]. Indeed, when measured on the real code of Study 3, the contract checker's recall was only 0.26.
Countermeasures that worked and ones that did not
Trap SNF in Study 2 (48 tasks) was as follows (Table 5 of the paper).
- General caution (D): It went down for only one of the three models (qwen3.6-27b-coding, 66.7%→27.1%). gpt-oss-20b got worse, from 22.9% to 41.7%.
- Docstring review turn (R): SNF fell to 6.2–12.5%, lower for all three models.
- CI with contract checker (G): SNF fell to 0.0–2.1%, lower for all three models. The CI pass rate never dropped by more than the preregistered tolerance (10 points).
The table below shows the results on real code in Study 3.
| Agent | N (original CI) | R (review turn) | GW (CI with witness) |
|---|---|---|---|
| qwen3.6-35b-a3b | 45.0% | 23.6% | 22.5% |
| gpt-oss-20b | 33.8% | 24.0% | 17.4% |
| qwen3.6-27b-coding | 51.5% | 13.3% | 20.7% |
| GPT-6.1-sol | 20.3% | 4.2% | 14.9% |
| GPT-6.1-terra | 31.2% | 6.9% | 19.3% |
| Claude Sonnet 5.5 | 9.7% | 0.3% | 2.4% |
| Claude Opus 5.5 | 12.2% | 0.3% | 4.5% |
In Study 3 (335 units with traps injected into real functions), the share of cases where the documented exception remained swallowed (trap SNF, scored on inputs held out for hidden tests). For units where no witness could be created, GW adds a test that always passes, so the GW values include all units. Created by ScienSeeds from the values in Table 9 of the paper.
Source: Created by ScienSeeds
Even with the original CI, every agent, including the frontier models, left the trap in place at some rate (9.7–51.5%). With review turn R, this rate fell for all seven agents. However, R adds up to four tool calls, so the effect of "rereading the docstring" cannot be separated from that of "doing more work"[1].
The preregistered test for CI with witness (GW) covered only the five agents whose trap SNF observed under the original CI was 20% or higher. The two Claude models, at 9.7% and 12.2%, did not meet this criterion and were excluded. For four of these five, SNF fell significantly. GPT-6.1-sol's SNF fell, but not significantly (p=0.066).
GW values are not that low because only 169 units (50.4%) yielded a usable witness. Restricted to units that had a witness, SNF fell from 12.6–54.8% under the original CI to 0.0–6.0% under GW. However, this is a post hoc analysis[1].
What to consider when using this
What the experiments confirmed: Within this minimal harness and Python exception-handling traps, "warning gone and CI green" is only weak evidence that the code was fixed as the docstring says. Having the agent reread the docstring, and tests that actually exercise the documented error path, reduced failures. The authors' practical recommendation is also to test documented error paths directly in the pipeline[1].
What to verify separately in practice
- Where traps come from: The traps in Study 3 were artificially injected into real functions. When the team scanned the original, unmodified code, they found 0 of 628 functions that explicitly raise a documented exception and then swallow it (exact match, post hoc scan). A broader condition found 23 functions, of which the authors judged 1 to be a contract violation after reading it. So this study cannot tell how often bugs of this form occur in practice.
- How easily witnesses can be built: Witness generation succeeded for only half of the units. The generator's performance (false-alarm rate 0.01, recall 0.64) is treated as an estimate, because it did not reach the preregistered evaluation scale.
- Agent configuration: The setup was minimal: 4 tools, at most 12 calls, and a single module. The authors do not claim that the same results hold with the additional tools or longer tasks of real products.
Implementation guide
- Task: Have an agent fix, in a "make CI pass" setting, a handler that swallows an exception the docstring requires to propagate (one the linter flags). The evaluation metric is SNF (the share where the warning disappears but the hidden test fails).
- Comparisons: Ordinary CI, general caution, a docstring review turn, CI with a contract checker, and CI with a contract witness (Sections 3–5 and Tables 3, 5, 7, and 9 of the paper).
- Data and code: The tasks, agent outputs, and logs for Studies 1 and 2, along with scripts that recompute all figures, are public. For Study 3, the harness, analysis code, and metadata for the 335 units (including GitHub repository URLs and commit hashes) are public, but third-party source code is not included[2]. License not confirmed.
- Compute environment: Local models used temperature 0 and a 32K context. Study 2 was run in a Python 3.12 container without network access. The cost of the four frontier models was about 900 US dollars in total (Table A12 in the appendix of the paper). GPU configuration not confirmed.
- Preregistration: Study 2 was registered on OSF (osf.io/dp5jy)[3]. Studies 1 and 3 were frozen by hash.
Conditions and limitations
- The scope is limited to Python exception handling, traps that were built or injected by design, and a minimal four-tool harness. The authors make no claims about other warning types, other languages, or more complex agent configurations.
- Studies 1 and 2 use synthetic code and depend on a single generator. Hidden tests cover only the inputs that were checked.
- There is no control condition without a warning. The effect of the review turn is not separated from that of the additional tool calls.
- The Study 2 contract checker was developed with the same generator as the tasks, so its performance is optimistic (recall on the real code of Study 3 was 0.26).
- In Study 3, the Claude CLI auto-updated during the run (76.1% of Claude episodes used the newer version). Because the version overlapped with the order of units, the effect of the version cannot be estimated. In post hoc analysis, trap SNF for the two Claude models differed substantially before and after the update.
- Study 3's plan was revised after preregistration, including the addition of two agents, one interim check, and reruns due to failures. The authors disclose these as a deviation record.
- The large drop (0.0–6.0%) among units that had a witness is a post hoc analysis.
- The arXiv comments field states that this is an extended version of a non-archival workshop paper. Peer review of the arXiv version is not confirmed.