Part 4 of 11 · 2 min read
A monitor that replans before it escalates pays for itself
Giving a stuck agent one fresh instruction before giving up on it entirely recovers a majority of the stalls that a hard stop would have wasted.
Think of a lost driver who has been circling the same block. A good passenger does not immediately demand they pull over and call for help. They first suggest trying a different route. They only call for help if that does not work either.
In plain words: a progress ledger is an explicit, per-step record of whether the request is satisfied and whether progress is being made, a replan means giving a stalled agent new instructions, and escalation means stopping and handing the task to a person once replanning has failed repeatedly -- because a replan frees a genuinely stuck agent most of the time, trying it first before giving up catches a real majority of stalls for a fraction of the cost of simply abandoning the run.
A worked example. Adding a stall detector (with replan-then-escalate) to verification-plus-budget raises mean cost per task only slightly, from 20.3 to 21.8, but cuts wasted cost on failed runs from 10.6 to 6.7 and lowers cost per successful task from 31.7 to 28.3 -- cheaper overall, because most stalls get fixed by a replan rather than burning the rest of the budget. At the stall threshold's sweet spot (5 idle steps before replanning), correct outcomes peak at 0.89; too tight a threshold (2 steps) wrongly escalates 30% of genuinely possible tasks, and too loose a threshold (12 steps) never escalates anything but lets cost rise to 25.7.
The key lines. From code/mini-goals/goals.py:
# from code/mini-goals/goals.py
if stall and idle >= p.stall_k:
replans += 1; idle = 0
if replans > p.max_replans:
return {"outcome": "escalated_right" if infeasible else "escalated_wrong", "steps": steps, "cost": cost, "infeasible": infeasible}
if mode != "normal" and r.random() < p.replan_fix:
mode = "normal"
Read it as: escalation only happens once replans exceeds p.max_replans. Every stall below that count gets one more replan attempt first. p.replan_fix (70%) is the chance that attempt actually frees the agent. This ordering, replan before escalate, is structurally why the stall detector is cheap on average. Most of the time, the fresh instruction is all that was needed. Escalation is reserved for the genuine remainder.
Progress ledger, replan, escalation
A progress ledger is an explicit, per-step record of whether the request is satisfied, whether progress is being made, and what happens next. A replan is giving a stalled agent new instructions or a new plan. Escalation is stopping and handing the task to a person (or a more capable system) with what has been tried.
Example: 70% of replans freeing a stuck agent is the specific number that makes "try again with new instructions" cheaper, on average, than jumping straight to escalation -- without that recovery rate, the extra replan step would just be delay before an escalation that was always going to happen anyway.