Repository navigation
feat(customer-portal): reuse budget groups for organizations - #52411
Conversation
16aa160 to
df28877
Compare
|
@greptileai Please review organization tiers, override precedence, independent spend accounting, and the persisted calendar-cap regression on this commit. |
|
bugbot run Please review organization tiers, policy inheritance, independent spend counters, and the persisted override regression on this commit. |
[Medium impact] The PR appears safe to merge with no new actionable issues found.
|
Merging this PR will not alter performance1 warning
Comparing Footnotes |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
df28877 to
10939c6
Compare
|
@greptileai Please review 10939c65, including guarded migration replay and updated transaction fixtures. Application behavior and the recorded demo are unchanged. |
|
bugbot run Please review 10939c65, including the migration guard and transactional budget fixtures. The application code is unchanged. |
10939c6 to
5426729
Compare
|
@greptileai Please review 5426729, which rebuilds organization budgets around the existing group editor, configuration flow, and single budget reference. |
|
bugbot run Please review 5426729, which reuses existing budget groups for organizations with a single group-or-custom budget reference. |
5426729 to
d81c54e
Compare
|
@greptileai Please review d81c54e7. The revision helper was renamed for the recursion checker, and reset fixtures now support group lookups. |
|
bugbot run Please review d81c54e7, including the revision helper rename and the reset fixture update. Product behavior is unchanged. |
d81c54e to
7e5cbcc
Compare
|
@greptileai Please review 7e5cbcce. The only additional change aligns the shared editor’s delete button, verified in both organization and member views. |
|
bugbot run Please review 7e5cbcce. The delete button now uses the final grid column, verified in both editor scopes. |
7e5cbcc to
f455e81
Compare
|
@greptileai Please review f455e81. Customer budget now accepts a saved group or dollar amount directly in both create and edit flows. |
|
bugbot run Please review f455e81, including direct dollar entry, selecting numeric group names, blur persistence, and existing organization budget edits. |
|
@greptileai Please review 8f0ce2a9. Group reselection restores saved fields, while returning to custom dollars preserves private budget ownership and other limits. |
|
bugbot run Please review 8f0ce2a9. Both group and custom round trips now have regression coverage and live dashboard verification, alongside shared editing. |
8f0ce2a to
b9d2f64
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
bugbot run Please review b9d2f646. Both reported budget selection failures now have regression coverage and verified dashboard flows |
|
@greptileai Please review b9d2f646. Both budget selection issues are fixed, with saved ownership handling and live verification of clearing and catalog failures |
|
/devin review Please review b9d2f646. Catalog failures now preserve custom editing and protect saved group assignments, with live verification |
b9d2f64 to
d746e42
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
/devin review Please review d746e42. The shared budget label and custom-option hint now avoid claiming monthly resets for existing custom budgets |
|
@greptileai Please review d746e42. The final change corrects the shared budget label for non-monthly budgets, with matching regression selectors and recorded dashboard verification |
|
bugbot run Please review d746e42. The final change corrects the shared budget label for non-monthly budgets. The two original selection fixes retain their passing regression and live-dashboard proof |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d746e42. Configure here.
Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation.
* feat(customer-portal): set budgets per customer and gateway app Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation. * fix(customer-portal): show app usage and resolve CI regressions Use the existing dashboard controls and compact budget rows. Add app filtering to customer usage and retain trusted app context for budget rejections. Update request-header handling, tracing registry coverage, bounded app discovery, and optional caller-metadata tests. * fix(customer-portal): enforce app caps and charge each window once Enforce an authenticated app budget when optional customer and app headers are omitted. Normalize overlapping scalar and explicit budget windows to a single charge with the stricter cap and explicit reset time. Cover all app primitives through native HTTP auth and use realistic empty gateway configuration in existing test doubles. * fix(customer-portal): reuse budget controls and admission Use shared customer budget controls for app forms and resolve member budgets at one owner. Remove unused app lifecycle and listing routes. Parse request identity once, check each global and app scope once, and keep app counters alive through the existing database flush window.
…ers (#52485) * feat(customer-portal): set budgets per customer and gateway app Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation. * fix(customer-portal): show app usage and resolve CI regressions Use the existing dashboard controls and compact budget rows. Add app filtering to customer usage and retain trusted app context for budget rejections. Update request-header handling, tracing registry coverage, bounded app discovery, and optional caller-metadata tests. * feat(proxy): let each app decide whether it may create unknown customers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: sort imports Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): lock the app customer switch while its save is pending Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): refuse an unknown organization alias sent with a known member Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): refuse an unknown customer before reporting its organization's budget Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(ui): move the no-app customer switch into its own component Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(customer-portal): set budgets per customer and gateway app Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation. * fix(customer-portal): show app usage and resolve CI regressions Use the existing dashboard controls and compact budget rows. Add app filtering to customer usage and retain trusted app context for budget rejections. Update request-header handling, tracing registry coverage, bounded app discovery, and optional caller-metadata tests. * fix(customer-portal): enforce app caps and charge each window once Enforce an authenticated app budget when optional customer and app headers are omitted. Normalize overlapping scalar and explicit budget windows to a single charge with the stricter cap and explicit reset time. Cover all app primitives through native HTTP auth and use realistic empty gateway configuration in existing test doubles. * fix(customer-portal): reuse budget controls and admission Use shared customer budget controls for app forms and resolve member budgets at one owner. Remove unused app lifecycle and listing routes. Parse request identity once, check each global and app scope once, and keep app counters alive through the existing database flush window. * fix(customer-portal): preserve app attribution for deferred costs Persist the original trusted customer and app billing context on managed jobs. Restore it in batch and background cost polling with the original request time, preserving admission windows and existing claim behavior. Recognize the India Bedrock model prefix in dashboard model setup. * fix(ci): make migration repeatable and await scoped callbacks Set the required migration lock timeout and add the billing-context column only if it is absent. Use per-request completion test callbacks and await the MCP panel failure notification. Keep response, pricing, and complete callback-sequence assertions. * fix(ui): align Bedrock profile parsing with main Use the upstream country-prefix handling to clear the model-setup merge conflict. * refactor(proxy): resolve a customer under its registration rules in one helper Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: ishaan-j-berri <ishaan.j@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…52492) * feat(proxy): add per-team chargeback cost margins Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * fix(proxy): secure team pricing and surcharge budget reservations Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * chore(ui): regenerate team pricing endpoint descriptions Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * fix(proxy): preserve team pricing when archiving deleted teams Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * feat(proxy): replace the per-team margin with a surcharge on customer requests A cost_margin_config entry keyed customer adds a percentage to requests made for a customer organization. The surcharge is part of spend, so customer budgets count it, and each request records it in cost_breakdown and in a customer_margin_spend column on the daily spend tables so cost before the surcharge stays exact Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore: regenerate the lazy openapi snapshot Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: keep the accumulation suppression on its line Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor: read the recorded surcharge through a typed model Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): import the surcharge breakdown on the customer usage page Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): type the surcharge field where daily metrics are built Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): show a small surcharge to four decimals Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): reload margins after a refused save and drop the fixed amount for customer requests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style(ui): format the surcharge breakdown Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: carry the surcharge column in daily activity fixtures Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(customer-portal): set budgets per customer and gateway app Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation. * fix(customer-portal): show app usage and resolve CI regressions Use the existing dashboard controls and compact budget rows. Add app filtering to customer usage and retain trusted app context for budget rejections. Update request-header handling, tracing registry coverage, bounded app discovery, and optional caller-metadata tests. * feat(proxy): let each app decide whether it may create unknown customers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: sort imports Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): lock the app customer switch while its save is pending Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge requests charged to a customer through the key's binding Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: forward the surcharge through the grouped daily activity fixture Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge billed failure rows charged to a customer Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: keep the callback tests' existing formatting Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): refuse an unknown organization alias sent with a known member Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(proxy): let an app set its own surcharge on customer requests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): refuse an unknown customer before reporting its organization's budget Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge a customer-bound key at settlement and record no fields for a zero surcharge Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: a zero surcharge is covered by its own case Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(ui): move the no-app customer switch into its own component Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): read a key's customer binding from the trusted metadata bucket of any route Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(proxy): apply an app's surcharge to keys bound to a customer Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(customer-portal): set budgets per customer and gateway app Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation. * fix(customer-portal): show app usage and resolve CI regressions Use the existing dashboard controls and compact budget rows. Add app filtering to customer usage and retain trusted app context for budget rejections. Update request-header handling, tracing registry coverage, bounded app discovery, and optional caller-metadata tests. * fix(customer-portal): enforce app caps and charge each window once Enforce an authenticated app budget when optional customer and app headers are omitted. Normalize overlapping scalar and explicit budget windows to a single charge with the stricter cap and explicit reset time. Cover all app primitives through native HTTP auth and use realistic empty gateway configuration in existing test doubles. * test(proxy): let the customer usage fake answer app lookups for customer-bound keys Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): type the payload metadata read for customer attribution Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge billed failures on customer-bound keys and record the surcharge without a snapshot Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge billed failures whose customer binding sits beside litellm_params Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(proxy): drive a billed Responses failure on a customer-bound key through the failure callback Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(proxy): drive a billed Responses failure through the failure callback at each app surcharge Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(customer-portal): reuse budget controls and admission Use shared customer budget controls for app forms and resolve member budgets at one owner. Remove unused app lifecycle and listing routes. Parse request identity once, check each global and app scope once, and keep app counters alive through the existing database flush window. * fix(customer-portal): preserve app attribution for deferred costs Persist the original trusted customer and app billing context on managed jobs. Restore it in batch and background cost polling with the original request time, preserving admission windows and existing claim behavior. Recognize the India Bedrock model prefix in dashboard model setup. * fix(ci): make migration repeatable and await scoped callbacks Set the required migration lock timeout and add the billing-context column only if it is absent. Use per-request completion test callbacks and await the MCP panel failure notification. Keep response, pricing, and complete callback-sequence assertions. * fix(ui): align Bedrock profile parsing with main Use the upstream country-prefix handling to clear the model-setup merge conflict. * refactor(proxy): resolve a customer under its registration rules in one helper Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> Co-authored-by: ishaan-j-berri <ishaan.j@berri.ai>
…2496) * feat(proxy): add per-team chargeback cost margins Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * fix(proxy): secure team pricing and surcharge budget reservations Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * chore(ui): regenerate team pricing endpoint descriptions Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * fix(proxy): preserve team pricing when archiving deleted teams Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> * feat(proxy): replace the per-team margin with a surcharge on customer requests A cost_margin_config entry keyed customer adds a percentage to requests made for a customer organization. The surcharge is part of spend, so customer budgets count it, and each request records it in cost_breakdown and in a customer_margin_spend column on the daily spend tables so cost before the surcharge stays exact Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore: regenerate the lazy openapi snapshot Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: keep the accumulation suppression on its line Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor: read the recorded surcharge through a typed model Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): import the surcharge breakdown on the customer usage page Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): type the surcharge field where daily metrics are built Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): show a small surcharge to four decimals Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): reload margins after a refused save and drop the fixed amount for customer requests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style(ui): format the surcharge breakdown Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: carry the surcharge column in daily activity fixtures Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(customer-portal): set budgets per customer and gateway app Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation. * fix(customer-portal): show app usage and resolve CI regressions Use the existing dashboard controls and compact budget rows. Add app filtering to customer usage and retain trusted app context for budget rejections. Update request-header handling, tracing registry coverage, bounded app discovery, and optional caller-metadata tests. * feat(proxy): let each app decide whether it may create unknown customers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: sort imports Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): lock the app customer switch while its save is pending Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge requests charged to a customer through the key's binding Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: forward the surcharge through the grouped daily activity fixture Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge billed failure rows charged to a customer Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: keep the callback tests' existing formatting Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): refuse an unknown organization alias sent with a known member Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(proxy): let an app set its own surcharge on customer requests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(ui): list every application in the customer portal sidebar page Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): refuse an unknown customer before reporting its organization's budget Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge a customer-bound key at settlement and record no fields for a zero surcharge Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: a zero surcharge is covered by its own case Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: open the application from the list in the surcharge range test Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(ui): move the no-app customer switch into its own component Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): read a key's customer binding from the trusted metadata bucket of any route Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(proxy): apply an app's surcharge to keys bound to a customer Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * feat(customer-portal): set budgets per customer and gateway app Let administrators choose Teams, Projects, or Virtual Keys as the gateway-wide app scope and assign customer budgets from existing budget groups. Includes the shared budget-group integration from PR #52411 and builds on the existing app accounting implementation. * fix(customer-portal): show app usage and resolve CI regressions Use the existing dashboard controls and compact budget rows. Add app filtering to customer usage and retain trusted app context for budget rejections. Update request-header handling, tracing registry coverage, bounded app discovery, and optional caller-metadata tests. * fix(customer-portal): enforce app caps and charge each window once Enforce an authenticated app budget when optional customer and app headers are omitted. Normalize overlapping scalar and explicit budget windows to a single charge with the stricter cap and explicit reset time. Cover all app primitives through native HTTP auth and use realistic empty gateway configuration in existing test doubles. * test(proxy): let the customer usage fake answer app lookups for customer-bound keys Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): show window budgets, paginate applications and keep deep links on the application Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): type the payload metadata read for customer attribution Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): keep linked applications from loading forever and ignore invalid page sizes Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ui): keep the applications page number in the URL one-based Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge billed failures on customer-bound keys and record the surcharge without a snapshot Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(proxy): surcharge billed failures whose customer binding sits beside litellm_params Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(proxy): drive a billed Responses failure on a customer-bound key through the failure callback Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(proxy): drive a billed Responses failure through the failure callback at each app surcharge Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(customer-portal): reuse budget controls and admission Use shared customer budget controls for app forms and resolve member budgets at one owner. Remove unused app lifecycle and listing routes. Parse request identity once, check each global and app scope once, and keep app counters alive through the existing database flush window. * fix(customer-portal): preserve app attribution for deferred costs Persist the original trusted customer and app billing context on managed jobs. Restore it in batch and background cost polling with the original request time, preserving admission windows and existing claim behavior. Recognize the India Bedrock model prefix in dashboard model setup. * fix(ci): make migration repeatable and await scoped callbacks Set the required migration lock timeout and add the billing-context column only if it is absent. Use per-request completion test callbacks and await the MCP panel failure notification. Keep response, pricing, and complete callback-sequence assertions. * fix(ui): align Bedrock profile parsing with main Use the upstream country-prefix handling to clear the model-setup merge conflict. * refactor(proxy): resolve a customer under its registration rules in one helper Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com> Co-authored-by: ishaan-j-berri <ishaan.j@berri.ai>
Handwritten 1-3 sentence description
[insert handwritten description here]
Details
TLDR
Problem this solves
How it solves it
Intentional product change: typing a dollar amount replaces the selected group with a custom org budget. That org stops receiving changes to the group
User Flow
Before, the organization budget only accepts a dollar amount
/customersand click Create organizationAfter, the same field accepts either a saved group or dollars
/customersand click Create organization$40for a custom budget/customers/settingsChanges
CustomerBudgetGroups, its editor, validation and save flow for both scopesconfigure_templatesand the existing budget writer for group changesbudget_idFinal commit
d746e428: all required CI checks pass, Greptile is 5/5, Bugbot and Veria found no issues, and Devin shows no findings needing attention. All review threads are resolvedPre-Submission checklist
Screenshots / Proof of Fix
The proof below uses the actual dashboard, Postgres, Redis and real model requests, with baseline
8ad167030460bb0574a6c958c928465edce8fead. The review fixes were verified atb9d2f646; the final wording-only update and recording were verified atd746e428. The two-worker proxy commands and environment setup are belowBefore
GET /management/v1/customer_organization_budget_groupsreturns 404budget_idreturns 422After
$40monthly budgetorg-tiers-final-shared-demo.mp4
Chat Completions
POST /v1/chat/completionsreturns 200 with the shared groupResponses
POST /v1/responsesreturns 200 with the shared groupMessages
POST /v1/messagesreturns 200 with the shared groupThe recording shows the shared editing and switching flows. Returning to a saved group discards temporary custom edits. Returning to custom dollars preserves its private budget ID, reset period and yearly cap. Tests verify rejected saves and empty responses preserve drafts in both scopes. Clearing monthly dollars preserves other custom limits. Unchecking Set a budget and limits removes the whole custom budget. The custom-window edit was verified again through the dashboard with $150 historical spend, a $25 monthly window and a $1,000 yearly window. All three model endpoints returned 200 and the scalar cap stayed unset
The 22 live receipts also cover alias and member cache invalidation, concurrent budget edits rejecting stale revisions, generic budget updates, and preserving reusable rows after the last org is deleted. The API example below was executed successfully against the unchanged budget-enforcement implementation
Local verification passed 285 backend tests, 100 affected dashboard tests, production type checking, the production build, API-type synchronization and
make check. The earlier enforcement proof covered 88 of 89 added executable lines and killed all five behavior mutations for ownership, deletion and stale revisions. This update changes response metadata and editor state only; the enforcement paths are unchangedBudget selection review fixes and real dashboard recording
The review findings reproduced on
8f0ce2a9. Clearing an unsaved group choice removed a private budget, and a catalog 503 disabled custom dollar entryOn
b9d2f646, the same dashboard flow keeps the private budget ID, $1,000 yearly cap, 7d reset, and rate limits when clearing the amount. With only the catalog GET returning 503, the real dashboard creates a $40 organization and edits an existing custom budget to $60 and 300 TPM. A shared organization stays assigned to its group when saving its display name during that failureBefore, custom dollars and limits are unavailable during a catalog failure
After, dollars and custom limits remain editable during the same failure
org-tiers-review-fixes.mp4
The final tip
d746e428also corrects the shared label and custom-option hint so they do not describe a saved 7d or non-recurring budget as monthly. This final diff changes only wording and the matching test selectors. The earlier outage recording atb9d2f646still proves the unchanged save behavior; all 100 focused UI tests andmake checkpass againBefore, the $75 seven-day budget is labelled monthly
After, the same budget has an accurate label and retains its seven-day reset
Final-tip recording of editing dollars and clearing a temporary group while preserving custom limits
org-tiers-final-reviewed.mp4
To repeat the clearing case, open
/customers/manage?org=qa-ui-simple&tab=settingswith a custom budget, select Growth, click Clear, then Save changes. The yearly cap and rate limits remain. Unchecking Set a budget and limits remains the explicit full-removal actionTo repeat the outage case, save the local forwarding script below as
catalog_fault_proxy.py, run it, and restart the dashboard withNEXT_PUBLIC_USE_REWRITES=true LENS_DEV_PROXY_URL=http://127.0.0.1:4190. It forwards authenticated requests to the real proxy on 4188 and returns 503 only for the catalog GET whileqa/catalog-unavailableexistsmkdir -p qa touch qa/catalog-unavailable python3 catalog_fault_proxy.py # In the dashboard directory, with the same local authentication environment NEXT_PUBLIC_USE_REWRITES=true LENS_DEV_PROXY_URL=http://127.0.0.1:4190 \ ../../scripts/with_dashboard_node.sh npm run dev -- --port 3188 --hostname 127.0.0.1Create an organization with
$40, then edit a private budget's dollars and rate limits. Both save against the real proxy. For a shared organization, only unrelated fields remain editable until the catalog loads. Removeqa/catalog-unavailableto recover the catalogThe regressions fail on the prior code. The final focused run passes 100 UI and 285 backend tests, including both member and organization group editing
Exact local setup and executed API workflow
Use an isolated Postgres instance on port 55817 and Redis on port 55818. Set
DATABASE_URL,LITELLM_MASTER_KEY,UI_USERNAME,UI_PASSWORD, andLITELLM_DEV_API_KEYin the process environment. SetPROXY_BASE_URLandLITELLM_CORS_ORIGINStohttp://org-tiers.localhost:3188. Runmake bootstrapin each checkoutpython litellm/proxy/proxy_cli.py --config qa/final.yaml \ --host 127.0.0.1 --port 4188 --num_workers 2 --detailed_debug \ --reload --use_v2_migration_resolver cd litellm/ui/litellm-dashboard NEXT_PUBLIC_USE_REWRITES=true LENS_DEV_PROXY_URL=http://127.0.0.1:4188 \ ../../scripts/with_dashboard_node.sh npm run dev -- --port 3188 --hostname 127.0.0.1For baseline use API port 4187, UI port 3187, Redis database 0 and a separate database. Copy that populated database before starting the final proxy. The PR uses the unchanged baseline schema
Run this script with
API=http://127.0.0.1:4188and the private admin key inLITELLM_MASTER_KEY. It retains existing groups and removes its two test organizations and key afterward. The isolated instance needs room for two organizations under the free-tier limitExpected output is 200, 422, then 200 for each of the three model endpoints, followed by
Calendar group update and custom switching passedType
New Feature
Final Attestation
Note
Medium Risk
Changes customer-org budget assignment, shared budget lifecycle, and cache invalidation on catalog updates—areas that affect spend enforcement—but extends existing group configuration rather than new schema or auth paths.
Overview
Adds a proxy-admin catalog of reusable organization budget groups (GET/PATCH
customer_organization_budget_groups), stored as budget IDs in existinglitellm_config, with the same revision-checked save flow as per-org member groups. Customer organizations can now assignbudget_idto a catalog group or keep a privatebudget, withbudget_is_sharedon responses; switching to custom dollars forks off the shared row, and generic budget delete is blocked for catalog entries.The dashboard gets a Customer Management Settings page and a unified budget combobox (saved group or typed amount) on create/edit org flows, reusing the shared group editor in a global mode without member-default controls.
SearchSelectgains controlled input so custom amounts commit without losing a prior group selection.Reviewed by Cursor Bugbot for commit d746e42. Bugbot is set up for automated code reviews on this repo. Configure here.