Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/openfang-kernel/src/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4656,8 +4656,8 @@ fn apply_budget_defaults(
budget: &openfang_types::config::BudgetConfig,
resources: &mut ResourceQuota,
) {
// Only override hourly if agent has the built-in default (1.0) and global is set
if budget.max_hourly_usd > 0.0 && resources.max_cost_per_hour_usd == 1.0 {
// Only override hourly if agent has unlimited default (0.0) and global is set
if budget.max_hourly_usd > 0.0 && resources.max_cost_per_hour_usd == 0.0 {
resources.max_cost_per_hour_usd = budget.max_hourly_usd;
}
// Only override daily/monthly if agent has unlimited (0.0) and global is set
Expand Down
2 changes: 1 addition & 1 deletion crates/openfang-types/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl Default for ResourceQuota {
max_tool_calls_per_minute: 60,
max_llm_tokens_per_hour: 1_000_000,
max_network_bytes_per_hour: 100 * 1024 * 1024, // 100 MB
max_cost_per_hour_usd: 1.0,
max_cost_per_hour_usd: 0.0, // unlimited
max_cost_per_day_usd: 0.0, // unlimited
max_cost_per_month_usd: 0.0, // unlimited
}
Expand Down