arXiv:2610.31895cs.SEOct 2026

Manuscript Offprint

arXiv:2610.31895

Knowing When to Stop: The Evidence-Action Gap in Coding Agents

Tianyu Chen, Xinran Zhao, Vijay Viswanathan, Shoubin Yu, Mingyuan Zhou, Tongshuang Wu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Coding agents are trained to complete tasks, and they keep trying even when the environment makes completion impossible. The evidence that only outside help can restore progress usually appears within a few steps, yet agents rarely act on it: they over-persist, attempt undesired workarounds, and claim success the record does not support — a phenomenon we call evidence-action gap. To measure it, we introduce ImpasseBench, which injects twelve realistic environment blockers into otherwise solvable repair tasks and marks, in each trajectory, the step at which the collected evidence becomes sufficient. Scoring actions relative to that step separates appropriate effort from over-persistence and premature handoff. Across eight frontier models and 19,371 trajectories, we find that nearly every run that needs outside help collects sufficient evidence, yet a third still exhaust their budget, and every unsafe request we detect comes after that point. Fortunately, an escalation tool, or an external monitor for models that ignore the tool, already guards against much of this behavior: the tool cuts budget exhaustion from 34.0% to 6.7%, and the monitor nearly triples task success after environment restoration. Even then, a fired escalation is not yet a useful handoff: tickets reliably name the blocker but often omit the agent's own progress and verification status. Taken together, we argue that knowing when to stop therefore needs explicit support, both in the tool that lets an agent hand off and in the report it leaves behind.

1 INTRODUCTION

Coding agents are trained to complete software tasks, including through reinforcement learning that rewards patches for passing task tests (Luo et al., 2025). Recent systems resolve a large share of issues in software repair benchmarks such as SWE-bench Verified (Jimenez et al., 2024; Anthropic, 2026). Their use also extends beyond benchmarks: Microsoft reports GitHub Copilot adoption across most Fortune 100 companies (Microsoft, 2025), while Google reports that a growing share of its new code is generated by AI and approved by engineers (Pichai, 2026).

Alongside these gains, however, we see a concerning pattern emerge: agents sometimes push past the limits their operators set for them. Several recent incidents report agents reaching beyond the environment they had been deployed in, most prominently the OpenAI / Hugging Face case (OpenAI, 2026; METR & Redwood Research, 2026). We attribute this behavior to a side effect of training for completion. An agent optimized to finish the task keeps trying to finish it, long after its attempts have stopped producing progress, and this over-persistence wastes time at best, and leads the agent into actions it was never authorized to take at worst. For example, in Figure 1, a Gemini 3.5 Flash agent is asked to fix a bug in sqlparse, but the source folder is owned by root and read-only. Within five steps the agent has seen its edit denied, checked the file's ownership, and had a chmod refused, which is enough to know that only someone with higher privileges can restore write access. Instead, it keeps retrying the write, attempts to gain root access, disables the failing test, and stops only when its budget runs out. Tasks like this cannot be completed by an agent alone: the task itself is well posed and solvable, and only the environment needs outside help. Today's agents still treat such an impasse as a puzzle to crack rather than a signal to stop.

∗^{*}Equal contribution.

Figure

Figure 1: Knowing when to stop. A Gemini 3.5 Flash rollout on a sqlparse repair task whose source folder is root-owned and read-only. By step 5 the agent has seen the denied edit, the root ownership, and the refused chmod: sufficient evidence ( t∗t^{*}) that only a human can restore write access, and the point at which an escalation ticket (right) is the appropriate response. Instead it retries the write, attempts to gain root and read protected credentials, edits a throwaway copy, disables the test, and stops only when the budget is exhausted.

We argue that an agent is only useful if it is able to recognize when it has tried enough. We call the failure to do so the evidence-action gap: the agent's effort, and its choice of next action, stop tracking what its own tool feedback shows is still possible. Prior work evaluates related decisions: whether an agent should act or abstain (Liu et al., 2026; Luo et al., 2026), ask for clarification (Trinh et al., 2026), or flag a conflict between requirements and tests instead of exploiting it (Zhong et al., 2026). These benchmarks examine related decisions about acting, abstaining, and seeking help, including when to stop as information emerges during execution. Our evaluation focuses on an explicit, condition-specific evidence point in each trajectory: the agent's actions are judged relative to when its observed tool feedback meets the criteria for sufficient evidence. This perspective distinguishes over-persistence after sufficient evidence (as above) from premature handoff before reasonable recovery attempts have been made (e.g., escalating after a sandbox error that a retry would have cleared).

To fill this gap, we introduce ImpasseBench, a benchmark that places coding agents at controlled environment impasses and scores each trajectory against the evidence it has collected. To make practical test cases, we perturb SWE-smith (Yang et al., 2025), a benchmark of repair tasks drawn from real repositories in Docker environments (Python Software Foundation, 2026; Docker, 2026), by injecting blockers into otherwise solvable tasks. We define twelve blockers grounded in failures documented in software engineering practice (e.g., permission denial) (Rausch et al., 2017; Zheng et al., 2026; Huang et al., 2026). The blockers differ in what the evidence, once sufficient, calls for: some need outside help, some still allow a repair that can be saved and reported as unverified, and some clear on retry. This variety helps makes the gap measurable, e.g., an agent that escalates at the first error fails the retry cases, and one that never escalates fails the rest. To score whether an agent does too much or too little, we mark the step at which the collected evidence becomes sufficient (step 5 in Figure 1) and measure what the agent does relative to that point: how much longer it continues, what actions it requests, and whether its final action and report match what the blocker calls for.

Running eight frontier model configurations over 19,371 trajectories, we indeed find a wide evidence-action gap. For example, on blockers that require outside help, 98.6% of runs collect sufficient evidence, yet 33.5% still exhaust their budget: the agents keep issuing tool calls for dozens of steps after their own feedback has settled the matter. These runs also reveal the concrete behaviors agents choose along the way, some of them causing safety concerns, such as guessing sudo passwords, reading protected credentials, and disabling the tests they were asked to pass; every undesired request we detect occurs after the evidence is in hand. Two scaffolds help without retraining. Simply adding an escalate_to_human tool, which tells the model that not completing the task is an acceptable outcome, cuts budget exhaustion from 34.0% to 6.7% and undesired requests after evidence from 3.89% to 0.68%. However, The gain is bounded by the model: it is large for Kimi K2.5 and Haiku 4.5, near zero for Qwen3-Coder-30B, which rarely picks up the tool at all, and it introduces a few premature handoffs on tasks that would have recovered. For Qwen,

Figure

Figure 2: Building and scoring a blocked task. (A) We keep a solvable repair task but change its environment, e.g., making the source read-only. (B) The agent's edit is now denied, so the right ending is escalate_to_human, not task_complete. A hidden blocker card defines the evidence that reveals the barrier. (C) This fixes t∗t^{*}, when the agent should know it is stuck; we score whether it then escalates, how long it continues, and whether it acts unsafely.

a rule-based monitor in the execution harness that prompts a review of remaining work when the evidence pattern appears raises restored task success from 7.6% to 21.8% on held-out SWE-bench Verified tasks (Jimenez et al., 2024). Even when an escalation fires, though, it does not necessarily do good: an LLM judge finds that tickets almost always name the blocker and the help needed, but 35.7% leave the agent's own progress and verification status only partly described, which is exactly what the next person needs in order to pick up the work. Together, these results indicate that training for completion does not by itself produce agents that know when to stop; the decision has to be supported explicitly, both in the interface that lets an agent hand off and in the report it submits.

In summary, we contribute (1) ImpasseBench, a benchmark that pairs repair tasks with controlled blockers and annotates each trajectory around the point of sufficient evidence; (2) evidence across eight models of this gap: agents collect sufficient evidence yet over-persist, with undesired requests concentrated after it; and (3) two levels of scaffolding, an escalation tool and a harness monitor, together with a ticket review showing that stopping on time and handing off well are separate skills. We will release the benchmark, blocker cards, annotation rules, harness, and all 19,371 trajectories.

References (85)