Search papers, labs, and topics across Lattice.
This paper introduces CodeRescue, a novel approach for coding agents that optimizes recovery routing in response to execution failures by balancing the use of inexpensive recovery attempts with the option to escalate to more powerful models. By incorporating a Conformal Risk Control (CRC) layer, the system adapts to varying budget constraints without requiring retraining, allowing for effective decision-making under different operational conditions. The results demonstrate that the calibrated recovery strategy significantly outperforms traditional fixed-action methods and binary escalation baselines, achieving a higher solve rate at a reduced cost.
Recovery routing can outperform escalation strategies by leveraging execution feedback, achieving a higher solve rate at only 35% of the typical recovery cost.
Coding agents increasingly operate in executable environments where a failed attempt produces actionable feedback rather than merely an incorrect answer. Existing cost-aware systems typically treat such failures as cascade decisions: try a cheap model first, then escalate hard cases to a stronger and more expensive model. In coding, however, execution feedback can also make further cheap-model recovery worthwhile, raising a budgeted deployment question: when should an agent spend more cheap compute, and when should it escalate? We formulate this post-failure decision as recovery routing over heterogeneous actions and train a supervised router from execution rollouts. To make the same router usable under changing budgets, we add a Conformal Risk Control (CRC) layer that selects a deployment-time cost penalty without retraining and provides marginal expected-cost control under exchangeability. Across held-out failures from five coding benchmarks, cheap recovery and escalation exhibit complementary success patterns. The calibrated frontier improves over fixed actions, prompt-only routers, and a binary cascade baseline; in the main GPT-5.4-nano/GPT-5.4 setting, one CRC-calibrated frontier point exceeds always-escalate solve rate while using 35% of its mean recovery cost. Code is available at https://github.com/Qijia-He/agent-budget-control.