Skip to content

fix: backport the management/v1 end-user filter and four dashboard fixes onto rc/1.95.0 - #34811

Merged
yuneng-berri merged 5 commits into
rc/1.95.0from
litellm_/backport-rc-1-95-0-db905c
Jul 27, 2026
Merged

fix: backport the management/v1 end-user filter and four dashboard fixes onto rc/1.95.0#34811
yuneng-berri merged 5 commits into
rc/1.95.0from
litellm_/backport-rc-1-95-0-db905c

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Five merged staging PRs are not on rc/1.95.0
  • /customer/aliases would otherwise ship in this rc
  • Four dashboard UI regressions would ship uncorrected

How it solves it:

  • Cherry-picks all five merges onto rc/1.95.0
  • Each pick is byte-identical to the staging original

Relevant issues

Backport of #34685, #34684, #34679, #34689 and #34691

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Tests come along with the picks; no test was written or altered for this branch

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

The behavioral proof for each change lives on its own PR, captured against a live proxy; nothing about the behavior differs here because each pick applied with zero divergence. Every git diff <pick>^ <pick> on this branch is byte-identical to git diff <merge>^1 <merge> on litellm_internal_staging, so what merged into staging is exactly what lands on the rc line.

What is worth re-running on this line, since it is the only pick with a runtime surface, is #34691. With a proxy on :4000 and the dashboard dev server on :3000, built from this branch:

  1. The old path is gone (expect 404):
curl -s -o /dev/null -w '%{http_code}\n' 'http://localhost:4000/customer/aliases?start_date=2026-07-25%2000:00:00&end_date=2026-07-26%2000:00:00' -H 'Authorization: Bearer sk-1234'
  1. Generate traffic so there are end users in the window:
for c in acme-corp acme_dev globex initech; do curl -s -o /dev/null http://localhost:4000/v1/chat/completions -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' -d "{\"model\":\"gpt-5\",\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}],\"user\":\"$c\"}"; done
  1. The new path returns the control plane envelope:
curl -s --globoff 'http://localhost:4000/management/v1/spend_logs/end_users?filter[startTime][gte]=2026-07-25T00:00:00Z&filter[startTime][lte]=2026-07-26T00:00:00Z&page_size=2' -H 'Authorization: Bearer sk-1234'
  1. A typo'd param is refused as an RFC 9457 problem document (expect 400 and content-type: application/problem+json):
curl -s -i --globoff 'http://localhost:4000/management/v1/spend_logs/end_users?filter[startTime][gte]=2026-07-25T00:00:00Z&filter[startTime][lte]=2026-07-26T00:00:00Z&q_typo=acme' -H 'Authorization: Bearer sk-1234' | head -20
  1. Every other route keeps the error shape its callers already parse (expect the OpenAI-style {"error": ...} body):
curl -s -i 'http://localhost:4000/customer/info' -H 'Authorization: Bearer sk-1234' | head -20
  1. UI check: open http://localhost:3000/?page=logs, click Filters, open the End User dropdown, and confirm it loads, pages as you scroll, and narrows as you type

For the four UI picks, the pages to eyeball on this branch are http://localhost:3000/?page=mcp-servers (tab strip, and the Add New MCP Server dialog) and http://localhost:3000/?page=models (toolbar dividers and the Team dropdown)

Type

🐛 Bug Fix

Changes

Five merges landed on litellm_internal_staging after rc/1.95.0 branched off at 215f05588d, and all five belong in this rc. Each one was cherry-picked with -x -m 1 in staging merge order, onto the rc tip, with no conflicts.

The one that has to make this release is #34691. /customer/aliases shipped into staging two days before the branch point, so it is not in any release yet and its wire contract is still free to change. If the rc goes out with it, the path, the param names and the response envelope each need a permanent legacy adapter carrying Deprecation and Sunset headers. Landing the move to GET /management/v1/spend_logs/end_users here keeps that from becoming true.

The other four are dashboard regressions with no backend surface: the MCP Servers tab strip rendering as a full-width grey bar (#34685), vertical toolbar dividers sitting flush with the top of their row rather than centered (#34684), the Add MCP Server dialog collapsing to 448px with its header action under the close button (#34679), and team ids overflowing the models table Team dropdown instead of truncating (#34689).

Nothing here is a rewrite of the originals. The management_v1 package does not exist on the rc line, so #34691 creates it whole rather than patching around an earlier version, and the schema.d.ts hunk it carries touches exactly two paths, dropping /customer/aliases and adding /management/v1/spend_logs/end_users, which is what regenerating on this line would produce. The line tab variant #34685 depends on is already present in the shadcn tabs primitive at the branch point, and after the picks nothing in the tree still references useEndUserAliases or /customer/aliases.

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

style(ui): match MCP Servers tabs to the dashboard's line tab pattern

(cherry picked from commit 63d6d8a)
…enter-b75b6d

fix(ui): center vertical toolbar dividers

(cherry picked from commit 9354849)
…n-c06977

fix(ui): restore the Add MCP Server dialog size and header spacing

(cherry picked from commit 19348db)
…truncate-2b2a3f

fix(ui): truncate long team names in the models table team dropdown

(cherry picked from commit 2f2e1e7)
…tandards-b1cd57

refactor(management): move the logs end-user filter onto /management/v1

(cherry picked from commit 2b7e01b)
@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds the management-v1 spend-log end-user facet and updates the dashboard to consume it, alongside focused fixes for MCP tabs and dialog sizing, toolbar separator alignment, and long team-label truncation

  • Moves the end-user filter from /customer/aliases to /management/v1/spend_logs/end_users
  • Adds scoped spend-log querying, strict query validation, pagination links, RFC 9457 error responses, route registration, and generated API types
  • Updates the logs dashboard hook and filter to use the new endpoint and response envelope
  • Corrects four dashboard layout regressions and adds regression coverage

Confidence Score: 5/5

The PR appears safe to merge; no concrete changed-code failure remains in the reviewed backend contract, authorization scope, dashboard integration, or layout fixes

The new endpoint remains authenticated and scoped consistently with the spend-logs UI, bounds its database scan, exposes matching generated client types, and is consumed by focused dashboard code with regression coverage

Important Files Changed

Filename Overview
litellm/proxy/management_endpoints/management_v1/spend_logs.py Adds the authenticated, role-scoped end-user facet with bounded SQL scanning, filtering, pagination, and problem-detail errors
litellm/proxy/management_endpoints/management_v1/common.py Introduces shared management-v1 query validation, problem responses, and pagination-link construction
litellm/proxy/proxy_server.py Registers the new router and limits the new validation-error contract to management-v1 paths
litellm/proxy/_types.py Places the new endpoint in the same internal-user and admin-viewer access tiers as the logs UI
ui/litellm-dashboard/src/app/(dashboard)/hooks/spendLogs/useSpendLogEndUsers.ts Replaces the legacy customer-alias hook with the generated management-v1 API contract and server-provided pagination links
ui/litellm-dashboard/src/components/view_logs/RequestLogsFilters.tsx Updates the End User dropdown to consume the new facet response while preserving search and infinite scrolling
ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_servers.tsx Switches the MCP navigation to the line-style tab variant and removes the full-width grey treatment
ui/litellm-dashboard/src/app/(dashboard)/mcp-servers/_components/mcp_discovery.tsx Restores the wide dialog layout and reserves space around its close control
ui/litellm-dashboard/src/app/(dashboard)/models-and-endpoints/components/AllModelsTable.tsx Centers the toolbar divider and truncates long team labels without losing their title text
ui/litellm-dashboard/src/components/shared/ToolbarSeparator.tsx Adds a reusable fixed-height, vertically centered toolbar separator

Reviews (1): Last reviewed commit: "Merge pull request #34691 from BerriAI/l..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri merged commit 16fa6fa into rc/1.95.0 Jul 27, 2026
5 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/backport-rc-1-95-0-db905c branch July 27, 2026 19:37
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