fix(ui): guard PriceDataManagementTab TabPanel with admin role check#24312
Merged
RheagalFire merged 1 commit intoBerriAI:litellm_oss_staging_03_21_2026from Mar 22, 2026
Conversation
The Tab label for 'Price Data Reload' was already guarded with all_admin_roles.includes(userRole), but the corresponding TabPanel was rendered unconditionally, causing the PriceDataManagementTab component to mount for all users. This component polls admin-only routes every ~30s: - GET /schedule/model_cost_map_reload/status - GET /model/cost_map/source For internal_user sessions, each poll produced a 401 ERROR log. Align the TabPanel render condition with the existing Tab guard. Fixes BerriAI#24308
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryThis PR fixes a missing role guard on the
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/ModelsAndEndpointsView.tsx | Adds all_admin_roles.includes(userRole) guard to PriceDataManagementTab's TabPanel, matching the identical guard already on its Tab label. One-line fix that prevents non-admin sessions from mounting the component and triggering repeated 401 errors against admin-only polling endpoints. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ModelsAndEndpointsView renders] --> B{Is user an admin?}
B -- Yes --> C[Render Tab: Price Data Reload]
B -- Yes --> D[Render TabPanel: PriceDataManagementTab]
D --> E[Polls status endpoint every 30s]
D --> F[Polls cost_map source every 30s]
B -- No --> G[Tab NOT rendered]
B -- No, before fix --> H[TabPanel STILL mounted - BUG]
B -- No, after fix --> I[TabPanel NOT mounted - FIXED]
H --> J[401 Unauthorized errors in proxy logs]
I --> K[No unnecessary API calls]
Last reviewed commit: "fix(ui): guard Price..."
Contributor
RheagalFire
approved these changes
Mar 22, 2026
053e923
into
BerriAI:litellm_oss_staging_03_21_2026
38 of 39 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a missing role guard on the
PriceDataManagementTabTabPanel that causes repeated401errors in proxy logs for all non-admin user sessions.Fixes #24308
Root Cause
In
ModelsAndEndpointsView.tsx, the Tab label was already correctly guarded:But the corresponding TabPanel was rendered unconditionally:
PriceDataManagementTabpolls two admin-only endpoints every ~30 seconds:GET /schedule/model_cost_map_reload/statusGET /model/cost_map/sourceFor
internal_userand other non-admin roles, every poll produces a401 Unauthorizederror in the server logs.Change
One-line fix. Aligns the TabPanel render condition with the existing Tab label guard.
Testing
internal_usersessions no longer trigger 401 errors for/schedule/model_cost_map_reload/statusor/model/cost_map/sourceImpact
internal_user,team, any non-admin role