Commit graph

4746 commits

Author SHA1 Message Date
Yuneng Jiang
2c41f3c291
[Fix] UI - Keys: strip empty premium fields from key update payload
The /key/update response echoes top-level defaults like policies:[] into
client state. On a subsequent edit, the form resends policies:[], which
the backend treats as "user is setting policies" and blocks with a 403
enterprise check regardless of value.

Drop premium metadata fields from the update payload when the current
form value and the previously persisted value are both empty. Genuine
clears (non-empty -> empty) still pass through so premium users can
clear policies as intended.
2026-04-18 12:17:45 -07:00
ryan-crabbe-berri
fc35c68108
Merge pull request #26003 from BerriAI/litellm_fix-extra-headers-not-persisting
fix(ui): extra_headers not persisting on MCP server edit
2026-04-18 12:08:35 -07:00
ryan-crabbe-berri
55d3229a63
Merge pull request #25879 from BerriAI/litellm_chore-migrate-router-settings-page-off-of-tremor
chore(ui): migrate router_settings page from Tremor to antd
2026-04-18 10:23:10 -07:00
ryan-crabbe-berri
2a76f10991
Merge pull request #25749 from BerriAI/litellm_chore-migrate-guardrail-test-playground-off-tremor
chore(ui): migrate GuardrailTestPlayground off @tremor/react to antd
2026-04-18 10:14:47 -07:00
Ryan Crabbe
545db8c4e1
Merge remote-tracking branch 'origin/main' into litellm_chore-migrate-router-settings-page-off-of-tremor 2026-04-18 10:10:12 -07:00
Ryan Crabbe
746d10f1dd
Merge remote-tracking branch 'origin/main' into litellm_chore-migrate-guardrail-test-playground-off-tremor 2026-04-18 10:06:55 -07:00
Ryan Crabbe
e2e5b63b41
fix(ui): revert submit guard to allow intentional extra_headers clearing
The ?.length guard prevented intentional clears from persisting — send
the form value as-is since initialValues now populates it correctly.
2026-04-17 23:24:46 -07:00
Ryan Crabbe
c28877757c
fix(ui): extra_headers not persisting on MCP server edit
Set extra_headers explicitly in initialValues instead of relying on
a useEffect setFieldValue call that races with Antd form initialization.
Also avoid sending empty array on submit so the backend's exclude_none
doesn't overwrite stored values.
2026-04-17 22:48:39 -07:00
Ryan Crabbe
a125ae697e
fix(ui): use stored-credentials endpoint for tools fetch on MCP edit page
The edit page was calling POST /mcp-rest/test/tools/list (the temp-session
endpoint that requires inline credentials) on mount. Since fetchTools
deliberately omits credentials from the request body, any server with
auth_type api_key/bearer_token/basic/authorization would 422.

Switch to GET /mcp-rest/tools/list?server_id=... which looks up stored
credentials on the backend — no inline creds needed for saved servers.
2026-04-17 22:42:07 -07:00
Ryan Crabbe
c3d94d08cf
fix(ui): stop injecting $0 cost into model update payload when cost fields are untouched
Editing a model in the Admin UI (e.g. to change credential) unconditionally
included input_cost_per_token: 0 and output_cost_per_token: 0 in the PATCH
payload, overriding built-in pricing from model_prices_and_context_window.json.

Guard cost fields with form.isFieldTouched so they are only sent when the
user explicitly modifies them. Intentional $0 cost (for budget bypass) still
works because the guard checks touched + non-null, not non-zero.
2026-04-17 22:25:31 -07:00
Yuneng Jiang
e004876950
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/wonderful-bouman
# Conflicts:
#	tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py
2026-04-17 21:32:09 -07:00
Yuneng Jiang
6fe79035d9
[Fix] UI - Settings: clarify Max-subscription vs BYOK toggle descriptions (independent of each other) 2026-04-17 21:21:43 -07:00
ishaan-berri
1c128a86b8
Merge pull request #25256 from BerriAI/litellm_ishaan_april6
Some checks are pending
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 30, 8) (push) Waiting to run
Unit Tests: Security / security (push) Waiting to run
Litellm ishaan april6
2026-04-17 16:26:45 -07:00
Ishaan Jaffer
e073feec0a
fix(ui): rename claude-code-plugins to skills in page_metadata.ts
page_utils.test.ts enforces that every menuGroups entry has a matching
description and vice versa. The left nav uses 'skills' but page_metadata.ts
still had 'claude-code-plugins', causing two test failures.
2026-04-17 15:49:24 -07:00
Ishaan Jaffer
70456fb8bb
fix(ui): update add_plugin_form tests to match rewritten smart URL form 2026-04-17 15:17:21 -07:00
Yuneng Jiang
7eae18d158
[Feature] UI - Settings: toggle row for forward_llm_provider_auth_headers 2026-04-17 13:32:17 -07:00
Ishaan Jaffer
e8461b5b97
style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
Ishaan Jaffer
4423d09845
fix(ui): add missing Accordion imports to TeamInfo.tsx 2026-04-17 12:47:27 -07:00
Ishaan Jaffer
665306b4f0
fix(ui): fix TypeScript error - publicPage === true in narrowed false context 2026-04-17 12:41:33 -07:00
Ishaan Jaffer
f31d4faa87
Merge origin/main into litellm_ishaan_april6 2026-04-17 12:36:51 -07:00
ryan-crabbe-berri
c23ce918cd
Merge pull request #25878 from BerriAI/litellm_refactor-pkce-dedup
Refactor: extract shared PKCE helpers into utils/pkce.ts
2026-04-17 10:26:22 -07:00
Ryan Crabbe
260679679f
fix(ui): repair router_settings tests broken by full antd mock
The antd mocks in RouterSettingsForm.test.tsx and index.test.tsx
replaced the entire antd module with only Select, so the Switch and
Button used by nested components failed to render. Use importOriginal
to preserve the rest of antd and override only Select.

Also fix the TagFilteringToggle click assertion — antd's Switch fires
onChange with (checked, event), so toHaveBeenCalledWith(true) was
always going to miss. Assert the checked arg directly instead of
coupling to antd's call signature.
2026-04-16 14:04:33 -07:00
Ryan Crabbe
72be35f9b8
chore(ui): migrate router_settings page from Tremor to antd
Replace @tremor/react components with antd equivalents:
- Button → antd Button
- TextInput → antd Input
- Switch → antd Switch
2026-04-16 11:01:30 -07:00
Ryan Crabbe
5aba1841cc
Extract shared PKCE helpers into src/utils/pkce.ts
Deduplicates base64UrlEncode, generateCodeVerifier, and
generateCodeChallenge which were copy-pasted across useMcpOAuthFlow
and useUserMcpOAuthFlow hooks.
2026-04-16 10:35:52 -07:00
ryan-crabbe-berri
ed0138b50e
Merge pull request #25812 from BerriAI/litellm_fix-invalidate-orgs-on-team-mutation
fix(ui): invalidate org queries after team mutations
2026-04-15 22:51:20 -07:00
ryan-crabbe-berri
18c93e0ccd
Merge pull request #25809 from BerriAI/litellm_fix_tool_test_panel_bool_rendering
fix(ui): use antd Select for MCP ToolTestPanel bool inputs
2026-04-15 22:50:57 -07:00
Ryan Crabbe
96415a5ac2
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix-invalidate-orgs-on-team-mutation 2026-04-15 22:41:38 -07:00
Ryan Crabbe
83095c24c6
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_tool_test_panel_bool_rendering 2026-04-15 22:41:09 -07:00
Ryan Crabbe
bbf204e602
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_fix_guardrail_optional_params_bool_rendering 2026-04-15 22:40:37 -07:00
yuneng-jiang
3914226ed7
Merge pull request #25796 from BerriAI/litellm_yj_apr14
[Infra] Merge dev branch
2026-04-15 17:01:23 -07:00
Yuneng Jiang
42ab3f94ce
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_yj_apr14 2026-04-15 15:59:45 -07:00
Yuneng Jiang
dabf8eaecb
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/elastic-zhukovsky 2026-04-15 15:55:52 -07:00
Yuneng Jiang
de7aad9def
[Feature] UI - Deleted Keys/Teams: Add Enterprise notice banner
Show an info banner on the Deleted Keys and Deleted Teams pages for
non-premium users indicating that deleted-record auditing is graduating
from beta into the Enterprise audit & compliance suite.
2026-04-15 13:55:13 -07:00
Ryan Crabbe
18afe6ab64
test(ui): update organization_view tests for useOrganization hook
Replace the organizationInfoCall mock with a vi.mock of the
useOrganizations hook module that stubs useOrganization (and
organizationKeys, which the component still imports for invalidation).
Each test now sets mockUseOrganization.mockReturnValue(...) instead of
mocking the underlying network call, matching the existing pattern in
TeamInfo.test.tsx.

Renders go through the canonical renderWithProviders helper from
tests/test-utils so the component's useQueryClient() call has a
QueryClientProvider in context. This is the standard wrapper used by
~96 other test files in the dashboard.

Fixes "No QueryClient set" failures in the 4 organization_view tests
introduced by the imperative-fetch -> useOrganization migration.
2026-04-15 13:47:13 -07:00
Ryan Crabbe
6e9cbbaad3
refactor(ui): migrate organization view to useOrganization hook
Replace the local orgData/loading useState + fetchOrgInfo useEffect in
OrganizationInfoView with the existing useOrganization(id) React Query
hook, and replace each post-mutation fetchOrgInfo() call with
queryClient.invalidateQueries({ queryKey: organizationKeys.all }).

This makes the org info page benefit from the React Query cache
invalidation already added for team mutations: editing a team's
organization elsewhere now refreshes the org's Teams badge list (and
all other org-derived data) without a hard reload.
2026-04-15 13:25:57 -07:00
Ryan Crabbe
c8496a2767
fix(ui): invalidate organization queries after team mutations
Team create/delete/update can change which teams belong to an organization
(via teamCreateCall, teamDeleteCall, and teamUpdateCall when organization_id
changes). Without invalidating the React Query cache for organizations, the
org info page's teams list and any useOrganizations() consumer (e.g. the
team edit form's organization dropdown) stay stale until a hard reload.

Export organizationKeys from useOrganizations and invalidate
organizationKeys.all after each successful team mutation, matching the
pattern used in hooks/projects, hooks/budgets, and hooks/accessGroups.
2026-04-15 12:55:08 -07:00
Yuneng Jiang
442a5aea0d
Move Send Invitation Email field under Metadata in both forms 2026-04-15 12:33:12 -07:00
Ryan Crabbe
35559c4d60
fix(ui): use antd Select for MCP ToolTestPanel bool inputs 2026-04-15 12:32:38 -07:00
Yuneng Jiang
a7c947f9dd
Move Send Invitation Email field directly below User Email in both forms 2026-04-15 12:31:23 -07:00
ryan-crabbe-berri
f9bffbb1b7
Merge pull request #25803 from BerriAI/litellm_guardrails-monitor-antd-layout
refactor(ui): reduce Tremor usage in Guardrails Monitor layout
2026-04-15 12:30:58 -07:00
Yuneng Jiang
55829c2254
Render Send Invitation Email as a labeled form item to align with other fields 2026-04-15 12:28:41 -07:00
Yuneng Jiang
fde7c1087a
Move Send Invitation Email checkbox into modal footer, add tests
Place the checkbox inline with the submit button (left-aligned,
vertically centered) in both the embedded and standalone forms.
Add Vitest tests verifying the /user/new payload shape: default true,
false when unchecked, in both form variants, plus an initial-state
check for the modal.
2026-04-15 12:24:41 -07:00
Yuneng Jiang
3ce67bacad
[Feature] UI - Users: add Send Invitation Email toggle to Invite User modal
The Invite User flow was calling /user/new without send_invite_email, so
the backend invitation-email hook (gated on send_invite_email is True)
was silently skipped. Add a checkbox, default on, so admins can opt
out when needed.
2026-04-15 12:16:33 -07:00
Ryan Crabbe
f04a5e7113
fix(ui): render guardrail optional_params bool defaults in Select
The bool branch of the guardrail optional params renderer was using
string values ("true"/"false") for Select.Option, so when the backend
declared a real JS boolean as default_value (e.g. Pillar
include_scanners/include_evidence, IBM block_on_detection), antd's
Form.Item initialValue did not match any Option and the Select
rendered empty. Switching to real boolean Option values lets defaults
flow through unchanged. This matches the sibling fix already applied
in guardrail_provider_fields.tsx for Noma use_v2.
2026-04-15 11:57:52 -07:00
Ryan Crabbe
48aa776032
refactor(ui): use antd grid for guardrails monitor metrics
Replace Tailwind grid wrappers with antd Row/Col in Guardrails Monitor overview and detail metric sections to keep layout primitives consistent with the ongoing antd migration.
2026-04-15 11:34:44 -07:00
Ryan Crabbe
b599c8bfd4
refactor(ui): reduce Tremor usage in Guardrails Monitor layout
Move Guardrails Monitor overview/detail layout wrappers and section heading components to antd/plain Tailwind while keeping the existing Tremor chart and date picker behavior unchanged for a smaller, low-risk migration step.
2026-04-15 10:39:25 -07:00
Yuneng Jiang
eba43b5c04
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_migration_projects
Some checks failed
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 30, 8) (push) Has been cancelled
Unit Tests: Security / security (push) Has been cancelled
2026-04-15 10:14:06 -07:00
Ryan Crabbe
3b8f651eaf
fix: default invite user modal global role to least-privilege
Pre-select "Internal User Viewer" in the Global Proxy Role dropdown
on both the standalone and embedded Invite User forms so admins don't
have to remember to pick a role, and the default lands on the least
privileged option rather than silently posting an undefined role.
2026-04-15 09:52:24 -07:00
Ryan Crabbe
a23408d937
test(ui): add getCookie to cookieUtils mock in user_dashboard test
user_dashboard.tsx imports getCookie from @/utils/cookieUtils, but the
vi.mock factory in user_dashboard.test.tsx only exports clearTokenCookies.
Vitest throws `No "getCookie" export is defined on the "@/utils/cookieUtils"
mock`, breaking all three beforeunload-listener tests.

Add getCookie to the mock factory so it matches the current imports.
2026-04-15 09:52:23 -07:00
Ryan Crabbe
27484c4a41
fix: isolate logs team filter dropdown from root teams state bleed
The Logs view's Team ID filter dropdown was reading `allTeams` from the
root `teams` state in page.tsx, which the Teams page search overwrites
with its filtered subset. Applying a team search on the Teams page made
filtered-out teams disappear from the Logs filter dropdown.

Swap the Team ID filter to use the existing `TeamDropdown` component via
a small `FilterTeamDropdown` wrapper that adapts it to the filter slot's
`FilterOptionCustomComponentProps` contract. The dropdown now drives its
own `useInfiniteTeams` query against `/v2/team/list` with server-side
search and an isolated react-query cache, unreachable from root state.

Rename the now-unused `hookAllTeams` destructure to `allTeams` so the
`KeyInfoView` passthrough receives the hook's unpolluted fetch instead
of the polluted prop, and drop the dead `allTeams` prop from
`SpendLogsTable` and both of its call sites.
2026-04-15 09:52:23 -07:00