Bug: token_budget is not actually enforced #17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Discovered during M2.3 smoke test (trace
1a8711c4-a65b-49fd-853e-50fde79c755f).Default
token_budgetis 20000, but the smoke run consumed 20,623 tokens before the agent caught the overshoot. Looking at the trace, the agent does check the budget — but only between iterations:iteration_start—tokens_so_far: 8268(under budget, proceed)web_searchcallsbudget_exhausted—20623/20000(caught, but already over)So enforcement is post-hoc within an iteration. By the time the check runs, the iteration's LLM calls have already happened. The 623-token overshoot is small here, but a more expensive iteration could blow past the cap by much more.
(Note: my earlier report incorrectly cited 48,521 tokens — I was reading the cli.main render output, which appears to include numbers from a different run. The trace is authoritative: 20,623.)
Suggested fix