foreman icon indicating copy to clipboard operation
foreman copied to clipboard

Turn-budget exhaustion is the dominant failure mode (49% of runs killed_turns)

Open n1arash opened this issue 5 months ago • 1 comments

Summary

The per-run turn budget (max_turns=30) is too tight for small/cheap reasoning models (haiku at effort=low). Agents routinely run out of turns mid-task, then retry / extend / escalate — and each killed run still costs $0.17–0.26. This is the dominant failure mode of the whole pipeline.

Evidence (dogfood campaign)

  • 21 of 43 agent runs (49%) ended killed_turns.
  • The slicer took 3 runs (2 killed) to emit issues; the feature initializer killed_turns.
  • F1/ISS-001 escalated with "turn budget exhausted after 2 extension(s)".
  • F3's grill killed_turns then errored out.
  • This is the root cause behind F1 (build:stuck), F3 (grill fail), the over-cost of F5, and most of the wall-clock.

Why it matters

The 30-turn cap suits a frontier model, not haiku. The flywheel payoff run could not move the needle because no skill-text patch can fix a too-small turn budget — only raising the budget can. This is the single highest-leverage fix in the backlog.

Proposed fix

  • Make the per-run turn budget model-aware: default higher for cheap models; a 30-turn cap is fine for a frontier model but not for haiku.
  • Optionally auto-scale by phase — grill/slicer need more turns than a single TDD slice.
  • Make killed_turns loud in the TUI and reports (today it's silent — see the observability issue).
  • Consider charging extensions against a wall-clock budget rather than re-running from a turn cap.

Acceptance criteria

  • [ ] Turn budget is derived from the worker model (and optionally phase), not a single hard-coded 30.
  • [ ] Cheap-model defaults are validated to complete a representative TDD slice without killed_turns.
  • [ ] killed_turns is surfaced in the TUI worker view and the run report.
  • [ ] A regression test asserts the model→turn-budget mapping.

Source: dogfood/ITERATION_REPORT.md BLOCKER-1; dogfood/METRICS.md outcome distribution.

n1arash avatar Jun 20 '26 15:06 n1arash

fixed by #12

n1arash avatar Jun 21 '26 09:06 n1arash