What problem would this solve?
In src/core/claude.ts, the per-step cost cap is passed as inv.maxBudgetUsd.toFixed(2). When the runner's remaining budget is a fraction of a cent (e.g. $0.004 left of a $2 ceiling), this sends --max-budget-usd 0.00. The runner's own budget.exhausted check (spent >= max) only fires between steps, so a step can still be invoked with an effectively-zero or ambiguous cap.
Proposed solution
Decide and document the intended behavior — e.g. round the cap up to 0.01, or treat "less than one cent remaining" as exhausted and skip the step. Add a test in tests/ covering the sub-cent boundary.
Alternatives considered
No response
Scope
What problem would this solve?
In src/core/claude.ts, the per-step cost cap is passed as inv.maxBudgetUsd.toFixed(2). When the runner's remaining budget is a fraction of a cent (e.g. $0.004 left of a $2 ceiling), this sends --max-budget-usd 0.00. The runner's own budget.exhausted check (spent >= max) only fires between steps, so a step can still be invoked with an effectively-zero or ambiguous cap.
Proposed solution
Decide and document the intended behavior — e.g. round the cap up to 0.01, or treat "less than one cent remaining" as exhausted and skip the step. Add a test in tests/ covering the sub-cent boundary.
Alternatives considered
No response
Scope