Skip to content

feat(runtime): NUDGE_REPAIR_BUDGET — cumulative ceiling on repair-round spend - #23

Merged
NekomyaDev merged 1 commit into
mainfrom
feature/repair-budget
Jul 29, 2026
Merged

NekomyaDev merged 1 commit into
mainfrom
feature/repair-budget

Conversation

@NekomyaDev

Copy link
Copy Markdown
Owner

NUDGE_REPAIR_BUDGET — repair rounds get their own wall (v1.2)

Discovered while testing against a live model: mimo-v2.5's repair round burned 946 output tokens vs 172 for the initial call — reasoning models think hard when told they failed. Retries aren't free, and most frameworks hide that spend.

What it does

  • NUDGE_REPAIR_BUDGET=<usd> caps cumulative repair-round spend across the run (initial calls never count against it — only rounds ≥ 1)
  • Hitting the wall raises BudgetExceeded, consistent with every other budget wall (NUDGE_BUDGET, per-call budget=)
  • Applies to both llm_call and llm_stream; replay mode exempt (zero token cost by definition)

Example

NUDGE_REPAIR_BUDGET=0.0015 python3 out/agent.py
# → BudgetExceeded: repair budget exhausted: $0.0020 spent of $0.0015

Verified

  • Live-tested in this branch's sandbox runs: wall fires at the right round, unlimited runs keep the old SchemaFailure behavior, schema-free calls unaffected
  • Rationale recorded in the trace already — repair_round + per-round tokens/cost are frozen-v1 fields, so trace-view/trace-diff show exactly what repairs cost

…nd spend

Reasoning models can make one repair round cost more than the original call
(observed live: mimo-v2.5 repair round burned 946 output tokens vs 172 for the
initial call). The new env var caps total repair spend across the run; hitting
it raises BudgetExceeded like any other budget wall. Applies to both llm_call
and llm_stream; replay mode is exempt.
@NekomyaDev
NekomyaDev merged commit 08ccc7c into main Jul 29, 2026
2 checks passed
@NekomyaDev
NekomyaDev deleted the feature/repair-budget branch July 29, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant