Op interpreter: enforce budgets incrementally

t-406·WorkTask·
·
·
Created1 month ago·Updated1 month ago

Description

Edit

Enforce budget limits incrementally in Op interpreter.

Problem

Limit checks are applied only after the whole Op finishes, so a run can exceed cost/token budget before failing.

Requirements

  • Track cost/tokens incrementally (per infer_end)
  • Stop execution once budget is exceeded
  • Emit exhausted event with accurate resource type

Acceptance

  • Runs stop close to budget threshold, not after full completion
  • Trace includes exhausted event with correct reason

Timeline (4)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago
💬[human]1 month ago

Sequential interpreter now enforces budget during infer calls (incremental), returns partial trace on exhaustion, and propagates exhaustion through Op.limit.