Skip to content

feat(customer-portal): share budget editors and app model access - #52784

Merged
tin-berri merged 19 commits into
mainfrom
litellm_budget_group_allowed_models
Nov 20, 2026
Merged

tin-berri merged 19 commits into
mainfrom
litellm_budget_group_allowed_models

Conversation

@tin-berri

@tin-berri tin-berri commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Unify customer and app budget editing with shared preset-or-custom controls and scoped model lists. App detail pages now separate Usage, Budget groups, and Settings; app, organization, team, and member pages share their header, navigation, and spacing.

Details

TLDR

Problem this solves:

  • Customer budget controls differ across scopes.
  • App pickers expose models and presets outside their scope.
  • Period edits can retain the previous reset deadline.

How it solves it:

  • Share budget fields, validation, and sparse update planning.
  • Keep template rows compact and individual editors split.
  • Save multiple app defaults from one footer action.
  • Reuse detail-page headers and navigation across app and customer scopes.
  • Add sortable app/customer usage tables with separate edit actions and reusable spend-limit editors.

Rebased onto main after #52976 merged. Its finalized custom-period backend is now part of the base. This UI PR adds no database columns or budget request fields. Its backend changes add an admin-only accessible-model lookup with normalized errors.

Intentional product change: Budget templates use compact rows containing spend limits, TPM, RPM, soft budget, and allowed models. Multiple spend amounts stay inline, with a plus button to confirm another amount and period. Individual entities retain the preset-or-Custom split editor. Blank spend removes that cap. No reset keeps a lifetime cap. Optional model lists add no restrictions when empty.

Overall app, organization-wide, and app × organization catalogs remain separate. App × organization defaults now live below their template catalog in Budget groups, with App on the left, Budget group on the right, Add app default, and one bottom Save changes button. Existing assignments from the older organization catalog remain labeled and cannot be newly selected. Per-app member defaults can now link to shared app-member budget groups or use optional custom limits. Each app has a Budget groups tab headed Per App Member Budget Groups, with its default beneath the catalog. Settings contains the overall app budget, surcharge, and whether the app may create new customers. Teams show the same custom fields directly because they have no template catalog, without a budget-source dropdown or enable checkbox.

User Flow

Before, template values occupy repeated form sections, and app defaults are edited separately in app settings.

  1. Open /customers/settings?tab=organization and compare the existing budget groups.
  2. Scroll through each group's repeated spend, rate, and model sections.
  3. Open Applications to edit an app's default customer group.

Before, expanded template sections

After, templates fit into rows and app defaults sit alongside their own catalog.

  1. Open /customers/settings?tab=organization and compare the same budget groups.
  2. Edit inline limits, including multiple spend periods, and save.
  3. Open Per-App Organization Budget Groups, change multiple app defaults, and use the bottom Save changes button.

After, compact template rows

Multiple app defaults with one footer save

The Add app budget identity fields also now align. Before at 3dbdd58e815, the app selector starts lower and is shorter than the organization field.

  1. Open /customers/usage?org=budget-source-proof and click Add app budget.
  2. Select Model lookup proof and compare the organization and app fields.

Before, uneven identity field spacing and height

After at 8fe13f58b688171f282d4c9e16be76ff1c3e4e3e, both fields have matching label spacing and 36px height.

  1. Open the same organization and Add app budget modal.
  2. Select the same app and compare the aligned labels and input borders.

After, aligned organization and app fields

Screenshots / Proof of Fix

Rebase verification at 30380cf00c1 on main b608fa878fbf, including #52976. The merged budget backend matches main. All 652 focused UI tests and 144 backend tests pass. make check passes, including Python gates, test-tree lint, dashboard lint budgets, and OpenAPI/type synchronization. The custom-cap regressions now exercise the shared forms, preserving custom windows and their reset identity while calendar caps are changed or removed. The original local logo edit was restored without committing it, and both Applications and Customers return HTTP 200 locally. GitHub reports no merge conflicts. The standalone dashboard production typecheck still reports the existing AgentControlPlaneView layout-export error in an unchanged file. CI and fresh Greptile/Bugbot reviews are pending.

The real dashboard runs locally at http://127.0.0.1:4336 against proxy 4356, isolated PostgreSQL, and shared Redis 6396. The screenshots above show the actual UI. The catalog uses synthetic model entries, so no inference request was needed for these configuration changes.

The budget persistence proof ran on the combined #52976 and #52784 code committed as 3dbdd58e815631e3dcab2c6eca11a063c05a31be. In one save, Budget Period Demo changed to No limit and Linked App Demo A changed to App model access demo. API readback confirmed both changes, five untouched app defaults, and unchanged overall budgets, member defaults, auto-create settings, and margins. Reload retained the selections. Separate integration coverage exercises multiple new rows, partial failures, stale refreshes, and retries without duplicate app creation.

The app × organization dropdown now offers only that catalog's groups. Two existing UI Standard assignments remain labeled as overall organization groups. Their current policies are retained until explicitly replaced.

Through the real UI, Tier 1 saved a $500 monthly cap, $6,000 yearly cap, $75 per 7d, 100,000 TPM, 1,000 RPM, and $400 soft budget. Readback returned primary max_budget=500 and budget_duration=1mo, plus budget_limits for 12mo and 7d, each with a reset deadline. Newly entered 6days and 6mo displayed validation and disabled Add. Custom chips display / 7d once.

Saved monthly, yearly, and custom limits in one row

The period regression was originally reproduced at 440fbe545d5 and corrected at d6247943c1c3. A yearly-to-monthly edit replaced January 1, 2027 with December 1, 2026. Amount-only edits retained the deadline, and member defaults reset independently. These paths remain covered after the rebase. Soft-budget-only edits retain their duration. Preset-to-Custom transitions retain the selected preset's extra windows and hidden policy.

Focused runs pass for the changed app/group editors, settings/dialogs, form parsers, and previously failing CI files. The app/default/group test cleanup retained all 96 cases. make check passes at the final tip. The app-budget modal integration file passes all 26 cases. Subsequent updates add app detail navigation, usage-table edit actions, shared spend-limit editors, and consistent detail-page layouts. Earlier screenshots and persistence probes below document the revisions named alongside them. OpenAPI snapshot and API type regeneration produced no extra diff. Local production typecheck reports only the existing generated dashboard-layout export error. CI and bot reviews are tracked separately.

At 5487e6a8421, the latest layout cleanup passed 130 focused integration tests across app defaults, app management and usage, customer budget groups, customer management, and customer usage. make check passed. The actual local dashboard was checked on app Budget groups and Settings, organization Usage and Settings, team Usage, and member Usage. This cleanup changes no backend/API/schema code. Shared test fixtures and assertions remain reused.

Team settings were also verified on /customers/manage?org=app-budget-ui-org&team=app-budget-ui-team&tab=settings. Directly entering 20,000 TPM and 30 RPM saved successfully with no dollar cap. The shared settings/dialog regression files pass all 53 tests, including a team with no existing budget.

Before, team custom fields require a checkbox

After, team custom fields are directly editable

The unchanged app-model endpoint was previously exercised for teams, projects, and keys. Missing resources return 404, lookup outages return 503, and authorization runs before the error boundary. The live key-rotation proof reproduced invalid-key responses and verified normalized errors and recovery.

Local reproduction setup and requests

Use an isolated local PostgreSQL database. The provider entries are synthetic and point to a closed localhost port. They are used only to populate the catalog.

general_settings:
  coordination_redis:
    host: 127.0.0.1
    port: 6396
  database_connection_pool_limit: 2
  disable_prisma_schema_update: true
  master_key: os.environ/LITELLM_MASTER_KEY
model_list:
  - model_name: validation-no-inference
    litellm_params: &demo_model
      model: openai/validation-no-inference
      api_base: http://127.0.0.1:9/v1
      api_key: os.environ/DEMO_UNUSED_PROVIDER_KEY
      timeout: 1
  - model_name: other-app-model
    litellm_params: *demo_model
router_settings:
  num_retries: 0
  redis_host: 127.0.0.1
  redis_port: 6396
  timeout: 2

The local launcher reads DATABASE_URL, LITELLM_MASTER_KEY, UI_USERNAME, and UI_PASSWORD from existing private local settings without printing them. Set DEMO_UNUSED_PROVIDER_KEY to any synthetic value. The equivalent commands are below. The recorded run used the same configuration with the unused synthetic value inline.

redis-server --port 6396 --daemonize yes
.venv/bin/python litellm/proxy/proxy_cli.py --config proxy-config.yaml \
  --host 127.0.0.1 --port 4356 --num_workers 2 --use_v2_migration_resolver
cd litellm/ui/litellm-dashboard
NEXT_PUBLIC_USE_REWRITES=true LENS_DEV_PROXY_URL=http://127.0.0.1:4356 \
  npm run dev -- --webpack --hostname 127.0.0.1 --port 4336

The endpoint probe creates an unrestricted two-model team, a one-model project beneath it, and a key in that project. Set TEAM_ID to the demo app team, PROJECT_ID to the project ID, and KEY_RESOURCE_ID to the stable UUID returned by /management/v1/apps/resources?resource_type=virtual_key.

curl -s http://127.0.0.1:4356/models?scope=expand -H "Authorization: Bearer $LITELLM_MASTER_KEY"
curl -s http://127.0.0.1:4356/management/v1/apps/resources/team/$TEAM_ID/models -H "Authorization: Bearer $LITELLM_MASTER_KEY"
curl -s http://127.0.0.1:4356/management/v1/apps/resources/project/$PROJECT_ID/models -H "Authorization: Bearer $LITELLM_MASTER_KEY"
curl -s http://127.0.0.1:4356/management/v1/apps/resources/virtual_key/$KEY_RESOURCE_ID/models -H "Authorization: Bearer $LITELLM_MASTER_KEY"

The screenshots show actual browser interaction with this proxy. Browser video recording was unavailable, so no new recording is claimed.

Race reproduction

Use the proxy setup above and an isolated database. With Prisma and httpx installed, set DATABASE_URL and LITELLM_MASTER_KEY locally and run this script. The warmup makes the after run reach concurrent reads after the new proxy starts. The original before run used the already warm proxy.

import asyncio
from collections import Counter
import json
import os
from pathlib import Path
import sys
from uuid import uuid4

import httpx
from prisma import Prisma

async def main():
    db = Prisma()
    await db.connect()
    identity = str(uuid4())
    await db.litellm_verificationtoken.create(data={'key_id':identity,'token':str(uuid4()),'key_alias':'Temporary model lookup race proof','models':['validation-no-inference']})
    results = []
    try:
        async with httpx.AsyncClient(base_url='http://127.0.0.1:4356',headers={'Authorization':f"Bearer {os.environ['LITELLM_MASTER_KEY']}"},timeout=20) as client:
            await client.get(f'/management/v1/apps/resources/virtual_key/{identity}/models')
            async def rotate():
                for _ in range(150):
                    await db.litellm_verificationtoken.update(where={'key_id':identity},data={'token':str(uuid4())})
                    await asyncio.sleep(0.003)
            async def lookup():
                for _ in range(45):
                    response = await client.get(f'/management/v1/apps/resources/virtual_key/{identity}/models')
                    results.append((response.status_code,response.json()))
            await asyncio.gather(rotate(),lookup(),lookup(),lookup())
            healthy = await client.get(f'/management/v1/apps/resources/virtual_key/{identity}/models')
            assert healthy.status_code == 200 and healthy.json() == ['validation-no-inference'], healthy.text
            result = {'scenario':'Concurrent rotation of an isolated test key without a grace period','requests':len(results),'status_counts':dict(Counter(s for s,_ in results)),'errors':list({json.dumps(body,sort_keys=True) for status,body in results if status!=200}),'recovered':{'status':healthy.status_code,'models':healthy.json()}}
            print(json.dumps(result,indent=2))
    finally:
        await db.litellm_verificationtoken.delete(where={'key_id':identity})
        await db.disconnect()

asyncio.run(main())
Period and shared-field reproduction

With the local setup above, create a test app through /management/v1/apps using a disposable team. Set both its budget and default_customer_member_budget to the following values. Use the returned app ID for API readback and the team ID in /apps?app=<team-id>.

{"max_budget":null,"budget_duration":null,"soft_budget":200,"tpm_limit":2000,"rpm_limit":100,"allowed_models":["validation-no-inference"],"budget_limits":[{"budget_duration":"12mo","max_budget":1200,"reset_at":"2027-01-01T00:00:00Z"}]}

Change the existing annual cap to monthly through the UI and save. Read /management/v1/apps/<app-id> to verify the next monthly deadline. Edit only its amount and verify the deadline remains unchanged. Repeat for the member default. For the main spend field, enter an amount and choose Custom with 7d, save, then choose No reset and save. The amount remains and the main duration becomes null.

On /customers/settings, add a group and fill the five shared controls. Save and read /management/v1/customer_organization_budget_groups to confirm those fields persist. Clearing a spend amount removes that cap without clearing TPM/RPM or model policy.

App defaults and custom-period reproduction

Open /customers/settings?tab=app. Add a template named Tier 1. Set the first spend amount to 500 per month, then use the plus button to add 6000 per year and 75 per custom period 7d. Enter TPM 100000, RPM 1000, and soft budget 400. Save. Entering 6days or 6mo in the custom-period field must disable Add and show the accepted format.

curl -s http://127.0.0.1:4356/management/v1/app_customer_organization_budget_groups \
  -H "Authorization: Bearer $LITELLM_MASTER_KEY"

The saved Tier 1 has max_budget: 500, budget_duration: "1mo", and extra 12mo: 6000 and 7d: 75 entries with reset deadlines.

In the defaults table below, select different groups for two apps. Click the single bottom Save changes button, reload, and confirm both assignments persisted. With unconfigured app resources available, Add app default allows several pending rows before that same save. Read /management/v1/apps before and after and compare default_tier_budget_id; unrelated budgets and other settings must stay unchanged.

Pre-Submission checklist

  • I have added meaningful tests
  • The focused tests covering my change pass locally
  • My PR passes all required CI/CD checks
  • Scope is shared customer budget and model configuration
  • Automated reviews on the latest commit have finished

Type

New Feature, Bug Fix, and Refactoring

Caveats

Low

  • Local typecheck retains an existing generated dashboard-layout error.
  • Browser recording was unavailable. Real UI screenshots are attached.
  • CI and fresh bot reviews on 30380cf00c1 are pending.

Final Attestation

  • Tests cover the intended behavior and identified regressions

Note

Medium Risk
Adds proxy management auth resolution for model listing and broadens budget PATCH/PUT surfaces across app and customer scopes, though changes are mostly UI with a narrow new read-only API.

Overview
Adds an admin-only management API to list models an app resource (team, project, or virtual key) may use, backed by app_resource_models and accessible_model_names with normalized 404/503 errors.

On the dashboard, app budgeting is split and reused: Settings holds overall app budget, surcharge, and customer auto-create; Budget groups pages edit shared templates and per-app organization/member defaults (including bulk save, custom member limits, and scoped model pickers fed by the new endpoint). Usage gets sortable tables, detail-page navigation, and organization spend editing via shared customer budget dialogs—per-customer org budgets no longer embed optional member limits in the same form.

Removes legacy pieces (AppBudgetEditor, AppProfileSelect) and expands integration coverage for defaults, settings, and usage flows.

Reviewed by Cursor Bugbot for commit 30380cf. Bugbot is set up for automated code reviews on this repo. Configure here.

@devin-ai-integration

devin-ai-integration Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@veria-ai

veria-ai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@tin-berri
tin-berri force-pushed the litellm_customer_org_remove_newest_first branch from 8268357 to ecb9d11 Compare November 19, 2026 19:02
Base automatically changed from litellm_customer_org_remove_newest_first to main November 19, 2026 19:49
@tin-berri
tin-berri force-pushed the litellm_budget_group_allowed_models branch from 79312d7 to 28027cf Compare November 19, 2026 19:56
@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai review 28027cf. Rebased onto main after #52682 merged. Only allowed-models changes remain. 146 focused tests, make check, and live persistence pass.

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

Please review 28027cf, rebased onto main. Eight frontend/test files remain. 146 focused tests, make check, and both live catalog saves pass.

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 3/5

[Medium impact] The changes reach related dashboard budget and usage workflows, plus a bounded admin model lookup.

Fix the two outstanding save failures before merging; the new custom-cap display issue is non-blocking.

Findings

  1. P1 Existing windows block edits ▶
  2. P1 Selected defaults disappear ▶
  3. P2 Custom cap spend disappears ▶

Summary

Shares budget controls across apps and customer scopes and adds scoped model choices.

  • Model pickers show only models available to the selected app resource.
  • Budget editors let people set several spend periods alongside shared limits.
  • App and customer budget defaults now live in separate catalogs and save together.
  • App detail pages and usage tables bring app and customer activity into one layout.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Editor[Shared budget editor] --> Patch[Sparse budget update]
  Patch --> API[Management API]
  API --> Stored[Stored budgets and windows]
  Resource[App resource] --> Access[Model access checks]
  Access --> Picker[Scoped model choices]
Loading

Reviews (8) · Last reviewed commit: "fix(ui): preserve custom budget checks a..." · Reviewed by Greptile

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai review a5663bc. App pickers now retrieve resource models from backend access checks. Optional clearing, live persistence, and 166 focused tests pass.

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

Please review a5663bc. Backend lookup now respects team, project, and key permissions. Optional clearing and live UI persistence are verified.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tin-berri

Copy link
Copy Markdown
Contributor Author

@cursor please review eac6fbdf1d1. Model lookup errors now use resource failures, with live rotation proof and six regression cases.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai please review eac6fbdf1d1. It fixes resource lookup errors and exposes budget fields, with passing regressions and live proof.

@cursor

cursor Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Unable to authenticate your request. Please make sure to connect your GitHub account to Cursor. Go to Cursor

@tin-berri
tin-berri force-pushed the litellm_budget_group_allowed_models branch from eac6fbd to 440fbe5 Compare November 19, 2026 21:29
@tin-berri tin-berri changed the title feat(customer-portal): allowed models on budget groups feat(customer-portal): organize app budgets and model access Nov 19, 2026
@tin-berri
tin-berri changed the base branch from main to litellm_app_linked_budget_groups November 19, 2026 21:29
@tin-berri

Copy link
Copy Markdown
Contributor Author

@cursor please review the updated app budget hierarchy, separate preset catalogs, custom save preservation, and scoped model access.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai please review the rebased UI and shared editors, especially preset selection, optional member limits, and existing budget preservation.

@cursor

cursor Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Unable to authenticate your request. Please make sure to connect your GitHub account to Cursor. Go to Cursor

@tin-berri tin-berri changed the title feat(customer-portal): organize app budgets and model access feat(customer-portal): share budget editors and app model access Nov 19, 2026
@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai please review d6247943c1c, especially shared budget serialization, preset-to-Custom transitions, preserved reset dates, and optional model restrictions across customer scopes.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@cursor review

Please check d6247943c1c for shared budget editor regressions, particularly spend-period changes, blank amounts, and preset-to-Custom transitions.

@tin-berri
tin-berri force-pushed the litellm_budget_group_allowed_models branch from 71e439c to 30380cf Compare November 20, 2026 09:09
@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai please review 30380cf after rebasing onto main with #52976 merged, especially shared budget editors and custom-window preservation.

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

Please review 30380cf after the #52976 rebase, including custom-window preservation, monthly spend rendering, and shared budget editors.

const parsed = parseBudget(fields);
if (
!validPrimaryPeriod(fields, original) ||
fields.budgetWindows.some(({ budget }) => !isValidBudgetDuration(budget.budget_duration))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Existing windows block edits

A stored 6days window now fails this check, even when the admin only edits a rate. The backend accepts that period, but the new strict check blocks saving unrelated changes. Preserve unchanged stored periods, as the primary-period check already does.

Knowledge Base Used: Dashboard and enterprise UI

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +212 to +218
: await fetchClient.POST("/management/v1/apps", {
body: { ...body, resource_id: id, resource_type: resource.resource_type },
});
return [
id,
response.data
? { appId: response.data.app_id, value: valueFor(response.data), saved: valueFor(response.data) }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Selected defaults disappear

If another admin creates a pending app before this save, the POST returns the existing app without applying the selected default. This code then replaces the draft with those unchanged settings and reports success. PATCH the returned app before clearing the draft.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

value: {
...(fields.budgetSource === "custom"
? { budget: { ...budget.value, ...budgetPolicyChanges(fields.policy, app?.budget) } }
: { budget_id: fields.budgetSource.startsWith("profile:") ? fields.budgetSource.slice(8) : null }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No limit leaves custom app budget

High Severity

Choosing No limit only sends budget_id: null and omits budget: null. Custom overall app budgets are stored in budget, so a sparse PATCH leaves that policy in place. After save and reload the app still has its custom cap instead of no limit. The previous settings form cleared this by sending budget: null when the budget was disabled.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 30380cf. Configure here.

customer.id,
customer.label,
row ?? { spend: 0, effective_budget: customer.id ? inherited : null },
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inherited customers show zero budget spend

Medium Severity

Customers that inherit the app default have no association row, so the table synthesizes spend: 0 and no budget_usage. Budget remaining and progress then look unused even when usage data for that customer is already on the row.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 30380cf. Configure here.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai please review 30380cf again after the rebase, rechecking prior findings, shared budget editors, custom-window preservation, and optional model restrictions.

@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

Please review 30380cf again after the rebase, rechecking prior findings, shared budget editors, custom-window preservation, and monthly spend rendering.

Comment on lines +147 to +150
const otherBudgets = budgets.filter(
(budget) => budget.source === "window" && customerBudgetPeriod(budget.budget_duration) === "other",
);
const customWindows = otherBudgets.length > 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Custom cap spend disappears

CustomerSpendCells now excludes primary caps from otherBudgets. For a member with a primary 7d or lifetime cap, the table stops showing that cap's recorded spend and reset date. It instead shows calendar-month spend with “No limit,” even though the cap still applies. Keep primary non-calendar caps in the displayed budget rows.

Suggested change
const otherBudgets = budgets.filter(
(budget) => budget.source === "window" && customerBudgetPeriod(budget.budget_duration) === "other",
);
const customWindows = otherBudgets.length > 0;
const otherBudgets = budgets.filter((budget) => customerBudgetPeriod(budget.budget_duration) === "other");
const customWindows = otherBudgets.some((budget) => budget.source === "window");

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

4 issues from previous reviews remain unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 30380cf. Configure here.

@tin-berri
tin-berri merged commit 53adbf6 into main Nov 20, 2026
66 checks passed
@tin-berri
tin-berri deleted the litellm_budget_group_allowed_models branch November 20, 2026 10:05
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