Manuscript Offprint

arXiv:2611.08285

Hard Issue, Weak Model, or Bad Run? Rethinking Failure Prediction for Coding Agents

Xingyue Shi, Wesley K. G. Assunção

Xingyue Shi

NC State University

Raleigh, NC, USA

xshi22@ncsu.edu

Wesley K. G. Assunção

NC State University

Raleigh, NC, USA

wguezas@ncsu.edu

Abstract—Trajectory-based failure predictors for software engineering (SE) agents read the partial trajectory of a run to flag whether it is going right or wrong. If it is going wrong, the run can be stopped, retried, or switched to another model. We ask whether these predictors learn anything about the run itself. On public SWE-bench Verified trajectories, where each model attempts each issue once, two run-independent factors dominate predictor performance. The first is issue difficulty: a reference score that never looks at the run, only at how hard the issue is for other models, reaches 0.92 AUROC, whereas trajectory predictors reach about 0.62. The second is model ability: within an issue, knowing which model ran predicts failure better than our predictors do, and the predictors largely reproduce the overall ability ranking of the models. Beyond difficulty and ability, what predictors gain from the trajectory is statistically equivalent to zero. This confusion carries over to the actions taken after a prediction. Model switching is often motivated by the gap between the best single model's resolution rate and an any-model oracle. This gap is no larger than random variation alone produces. Per-issue switching gains nothing on held-out runs. In a repeated-run pilot, the same model often solves an issue in some runs and fails it in others. Retrying thus has real room to repair failures, but it rescues only failures caused by a bad run, not those on an issue beyond the model's ability. Current predictors cannot tell the causes apart, as they mostly predict the issue and the model, not the run. We call for failure prediction that explains why a run fails, evaluated on repeated-run benchmarks and in closed-loop, equal-budget settings.

Index Terms—SE agents, failure prediction, trajectory monitoring, model routing, evaluation methodology

I. INTRODUCTION

Software engineering (SE) agents resolve repository issues by inspecting code, editing files, and running tests [1], [2]. Agent runs are usually long and often fail [3], [4]. A growing line of work therefore predicts failure while a run is still in progress and acts on the prediction: it stops the run to save tokens [5], [6], restarts the same model [3], or hands the issue to another model [7], [8]. We focus on trajectory-based predictors, which read only what the agent has produced so far (its reasoning, commands, and tool outputs) and therefore apply to closed frontier models.

A prediction can guide the choice of action only if it explains why the current run is likely to fail, using evidence from that run. A run can fail for three different reasons. The issue may be hard, so that most models fail it; the model may be weak, so that it fails many issues; or this particular

Figure

(a) Hard issue?

(b) Weak model?

(c) Bad run?

Fig. 1. A toy world in which each outcome depends only on the issue, the model, and a coin flip; values are probabilities, not empirical results. (a) Success on easy and hard issues. (b) Success with model A, model B, either model (Any), and A run twice (AA). (c) Retry success after a failure that a difficulty score flags (hard issue) or misses (easy issue, a bad run).

attempt may have gone wrong, a bad run, in which case the same model solves the same issue in other attempts. This decomposition follows item response theory, which explains each outcome by the difficulty of the item and the ability of the respondent [9]–[11], and the run-to-run variation observed when the same agent repeats a task [12]–[14]. Each reason calls for a different action: a hard issue for stopping or human intervention, a weak model for switching to a stronger one, and only a bad run for retrying.

Existing work, however, rarely tells these three reasons apart. We trace this to three assumptions that current practice takes for granted: (i) that a predictor with a high AUROC has learned run-specific information, that is, it predicts failure from the state of the current run; (ii) that the oracle gap, the success rate of any model minus that of the best single model, reflects issue-specific strengths that switching can exploit [15]; and (iii) that an alarm marks a bad run, so that acting on it, for example by retrying, pays off [3]. We question whether these assumptions hold. Standard evaluations cannot test them: predictors are usually scored with metrics pooled over many issues, and often over many models [3], [5], [16], [17]. Such a score mixes issue difficulty and model ability into one number, so a high value does not show that the predictor has learned anything from the run. Even with repeated runs, the score is dominated by comparisons between different issues [14]. That work separates issue difficulty from run-level failure within each model but does not examine model ability as a cause of failure or test the evidence for switching. On public leaderboard trajectories, each model attempts each issue once, so a bad run cannot be told from a hard issue or a weak model.

Fig. 1 shows how all three assumptions can fail in a toy world where each run is a coin flip whose success probability is set only by the issue and the model. There is thus nothing run-specific to learn, and no model is better than another on particular issues, yet the usual evidence for each assumption still appears. (a) A high pooled AUROC does not require learning about the run. Suppose a model succeeds with probability 0.9 on easy issues and 0.1 on hard ones, and the two kinds are equally common. A score that only knows whether an issue is hard reaches 0.90 pooled AUROC, yet it cannot rank two runs of the same issue (0.50). (b) An oracle gap does not require issue-specific strengths. Suppose model A succeeds with probability 0.7 and model B with 0.6 on every issue. Taking whichever model succeeds solves 1−(0.3×0.4)=0.881-(0.3\times0.4)=0.88 of the issues, 18 percentage points (pp) more than A alone, although A is the better choice on every issue. With the same two attempts, running A twice does even better (0.91): the gap comes from a second attempt, not from a better-suited model. (c) An alarm need not mark a bad run. In the world of (a), 90% of failures occur on hard issues (0.45 of 0.50), where a retry succeeds only 10% of the time; failures on easy issues are bad runs, which a retry fixes 90% of the time. The difficulty score from (a) raises alarms on hard issues, so it flags the failures a retry rarely fixes and misses those it usually fixes.

We ask whether real agents behave like this toy world, turning each assumption into a research question: RQ1: Do failure predictors learn about the run, beyond issue difficulty and model ability? RQ2: Does the oracle gap reflect issue-specific strengths that switching can exploit? RQ3: Do alarms mark bad runs that a retry can fix? On trajectories of seven recent models, outcomes of 23 models, and a public corpus with repeated runs, we find that real agents largely behave like the toy world, and the data support none of the three assumptions. Beyond issue difficulty and model ability, what predictors gain from the trajectory is statistically equivalent to zero (RQ1). The oracle gap is no larger than chance alone produces, and choosing a model for each issue from past runs brings no measurable gain on new runs (RQ2). Bad runs are common enough for retrying to pay off, but current predictors can hardly target them (RQ3).

Rather than proposing another predictor, we question what current predictors predict. Our answer is that they mostly predict the issue and the model, not the run, and that the evidence for acting on their alarms, whether by switching or by retrying, inherits the same confusion. We show how each assumption can be tested with existing data (Section IV) and call for failure prediction that explains why a run fails, so that each failure is met with the action that can fix it.

References (25)