Repository navigation
feat(budget): scope budgets to a provider - #1212
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
[Medium impact] The change affects budget checks and routing across routed inference paths. Fix the failover checks before merging so workflows that disable budgets can still use healthy backup providers.
|
| if o.budgetGate != nil && !o.budgetGate.ProviderWithinBudget(ctx, providerName) { | ||
| slog.Info("skipping over-budget failover target", | ||
| "request_id", requestID, | ||
| "to", qualified, | ||
| "provider", providerName, | ||
| ) | ||
| continue |
There was a problem hiding this comment.
Disabled budgets still block backups
When budgets are enabled globally but disabled for a workflow, admission skips budget checks. Both failover sweeps still call ProviderWithinBudget unconditionally. If the primary fails and the only healthy target has an exhausted provider budget, the request returns the primary error instead of using that target.
Honor workflow.BudgetEnabled() in both failover sweeps.
There was a problem hiding this comment.
Fixed in 2bbd01a: both failover sweeps now go through providerOverBudget, which skips the gate when workflow.BudgetEnabled() is false, matching admission. Covered by TestTryFailoverIgnoresBudgetsWhenWorkflowDisablesThem.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Adds a
providerbudget scope, mirroring provider rate limits. Refs #1202.Also
SET_PROVIDER_BUDGET_<NAME>,"scope": "provider"in the admin API, and a Provider option in the dashboard.provider_name, falling back toproviderfor older rows. No schema change.Summary by CodeRabbit
New Features
Documentation