Skip to content

[feature]: Sub-cent remaining budget rounds --max-budget-usd to 0.00 #8

Description

@faisalishfaq2005

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

  • I've checked this isn't already on the roadmap in the README.
  • This can't reasonably be expressed as a loop instead of engine code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions