Skip to content

Fix default hourly cost quota to unlimited instead of $1.00#392

Open
cryptonahue wants to merge 1 commit intoRightNow-AI:mainfrom
cryptonahue:fix/agent-cost-quota-default-unlimited
Open

Fix default hourly cost quota to unlimited instead of $1.00#392
cryptonahue wants to merge 1 commit intoRightNow-AI:mainfrom
cryptonahue:fix/agent-cost-quota-default-unlimited

Conversation

@cryptonahue
Copy link

Summary

  • ResourceQuota::default() had max_cost_per_hour_usd hardcoded to 1.0, causing agents to hit an unexpected $1/hour hard stop even when no budget was explicitly configured by the user
  • max_cost_per_day_usd and max_cost_per_month_usd already defaulted to 0.0 (unlimited) — this PR makes max_cost_per_hour_usd consistent with them
  • Changed default from 1.0 to 0.0 (unlimited)

Reproduction

  1. Install OpenFang via the install script on a fresh server
  2. Create any agent (or use the default dona template)
  3. Have an active conversation that exceeds $1.00 in LLM costs within an hour
  4. Agent stops with: Agent error: Resource quota exceeded: ... exceeded hourly cost quota: $1.XXXX / $1.0000
  5. The Budget settings page shows all agents capped at $1.0000 hourly even with global limits set to unlimited

Fix

// Before
max_cost_per_hour_usd: 1.0,

// After  
max_cost_per_hour_usd: 0.0, // unlimited by default

Test plan

  • cargo test -p openfang-types — 287 tests pass
  • cargo clippy -p openfang-types -- -D warnings — zero warnings
  • cargo fmt --all --check — no diff on changed file

The default ResourceQuota had max_cost_per_hour_usd set to 1.0, causing
agents to hit a $1/hour limit unexpectedly even when no explicit budget
was configured. This was inconsistent with max_cost_per_day_usd and
max_cost_per_month_usd which already defaulted to 0.0 (unlimited).

Changed the default to 0.0 (unlimited) to match the behavior of the
other cost fields and to avoid surprising users with hard stops during
normal agent usage.
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