Commit Graph
36985 Commits
Author SHA1 Message Date
Milan 7e656f4329 test: add unit tests for MCP initialize instructions feature
Extend existing test modules with coverage for the instructions merge
logic, upstream cache, ContextVar-based injection, and client-side
capture — following each file's established patterns.

Made-with: Cursor
2026-04-14 15:54:27 +03:00
Milan 8c2ebee4de refactor(mcp): reuse existing sessions for initialize instructions
Remove the gateway-specific initialize fetch path and reuse instructions captured during existing MCP calls (list_tools/health_check/call_tool), while keeping YAML/DB instructions as immediate overrides.

Made-with: Cursor
2026-04-14 14:46:06 +03:00
Milan 96ed00e184 feat(mcp): gateway InitializeResult.instructions from upstream or YAML
- Add optional instructions on MCPServer (config/DB/types) and Prisma migration.
- MCPClient: fetch_upstream_initialize_instructions() for one-shot initialize.
- Gateway merges per-request instructions: YAML/API overrides; otherwise fetch
  upstream initialize instructions (skip spec_path/OpenAPI-only servers).
- Pass auth headers into instruction merge; ContextVar for gateway Server.
- REST: wire instructions on connection-test MCPServer payloads.

Made-with: Cursor
2026-04-14 14:19:31 +03:00
yuneng-jiangandGitHub e64d98f725 Merge pull request #25590 from BerriAI/litellm_add_model_e2e_tests
[Test] UI - Models: Add E2E tests for Add Model flow
2026-04-13 19:03:39 -07:00
Yuneng Jiang 9b74ff3ef7 remove unnecessary cleanup helper
The database is freshly seeded on every test run via seed.sql,
so per-test cleanup is not needed.
2026-04-13 17:29:49 -07:00
Yuneng Jiang cce7163348 fix CI: replace data-testid selectors with text/role-based selectors
The data-testid attributes added to React components are not present
in the CI-built UI output. Switch to using getByRole and getByText
selectors which work with the rendered DOM regardless of build cache.
2026-04-13 17:29:49 -07:00
Yuneng Jiang 5e07c1cbc9 address greptile review feedback (greploop iteration 1)
Add cleanup helper to delete models created during tests, preventing
stale data accumulation across repeated test runs.
2026-04-13 17:29:49 -07:00
Yuneng Jiang 4f364a8138 [Test] UI - Models: Add E2E tests for Add Model flow
Add E2E tests covering:
- Test connection with bad credentials shows failure modal
- Adding a specific model and verifying it appears in All Models table
- Adding a wildcard route and verifying it appears in All Models table
- Verifying model dropdown shows provider-specific models (existing test updated)

Added data-testid attributes to UI components to support stable test selectors.

Tests verified passing 3/3 consecutive runs with zero flakiness.
2026-04-13 17:29:49 -07:00
yuneng-jiangandGitHub 8427534f13 Merge pull request #25647 from BerriAI/litellm_yj_apr_11
[Infra] Merge dev branch with main
2026-04-13 17:28:38 -07:00
yuneng-jiangandGitHub c25b4b2ce8 Merge pull request #25398 from BerriAI/litellm_team_settings_router
[Feature] UI - Teams: Allow Editing Router Settings After Team Creation
2026-04-13 17:27:15 -07:00
yuneng-jiangandGitHub a306092d47 Merge pull request #25463 from BerriAI/litellm_oss_staging_04_09_2026
Litellm oss staging 04 09 2026
2026-04-13 17:25:53 -07:00
ryan-crabbe-berriandGitHub 87b6b5145f Merge pull request #25658 from BerriAI/litellm_e2e-edit-team-model-test
test(e2e): add edit team model TPM/RPM limits test
2026-04-13 17:15:56 -07:00
Ryan Crabbe 152d6898ab test(e2e): drop cleanup from edit team model test
Reviewer flagged that cleanup failures were silently swallowed and
suggested asserting `delete.ok()`. While thinking through the fix, the
actual question turned out to be "does the cleanup matter at all?" —
and the answer is no.

The e2e runner (`run_e2e.sh`) spins up a fresh postgres container per
invocation and tears it down at the end, so every local and CI run
starts with an empty DB. Playwright retries share the same DB but each
attempt creates a new model with a unique `Date.now()` name and only
queries its own model, so orphans from failed attempts never collide
with later attempts or other tests. Nothing else in the suite reads
the all-models table.

Keeping the cleanup would also turn every write test into an implicit
delete test, coupling responsibilities and inflating runtime — which
is probably why `teams.spec.ts` (create a team), `keys.spec.ts`
(update key limits), etc. all leave their entities in place. Matching
that convention, drop the try/finally block and the `createdModelId`
tracking. 12 lines removed, no behavior change.
2026-04-13 17:05:42 -07:00
ryan-crabbe-berriandGitHub c08fb82cae Merge pull request #25657 from BerriAI/litellm_chore-e2e-tests
chore: remove deprecated tests/ui_e2e_tests/ suite
2026-04-13 16:51:22 -07:00
Ryan Crabbe 44614c43c6 test(e2e): add edit team model TPM/RPM limits test
Covers the full write-path flow for team-scoped models on the Models +
Endpoints page: create via /model/new, click the row to open the detail
view, click Edit Settings, change TPM/RPM, click Save Changes, assert
the new values render back. Cleans up via /model/delete in finally so
reruns stay deterministic.

Requires store_model_in_db: true in the fixture general_settings so the
proxy accepts /model/new and /model/delete. No existing test in the
dashboard e2e suite reads the all-models table or hits the model CRUD
endpoints, so enabling the flag has no cross-test impact.
2026-04-13 16:27:39 -07:00
Ryan Crabbe 004964f421 chore: remove deprecated tests/ui_e2e_tests/ suite
The suite was superseded by ui/litellm-dashboard/e2e_tests/ on 2026-04-08
and is no longer referenced by CircleCI, docs, or Makefile targets. Drop
the directory wholesale and remove the orphaned e2e:psql npm script that
pointed at its runner.
2026-04-13 15:40:34 -07:00
ishaan-berriandGitHub 548225ef31 Merge pull request #25586 from BerriAI/litellm_ishaan_april11
Litellm ishaan april11
2026-04-13 14:55:50 -07:00
ryan-crabbe-berriandGitHub 65d9fadf45 Merge pull request #25575 from BerriAI/litellm_feat-per-guardrail-opt-out-for-global-guardrails
feat(guardrails): per-team opt-out for specific global guardrails
2026-04-13 13:31:23 -07:00
ishaan-berriandGitHub 6e6ed4fa66 Merge pull request #25452 from mubashir1osmani/readme
docs: week 2 checklist
2026-04-13 13:23:48 -07:00
Ryan Crabbe 2d14e4a4ed test(ui/team): fix guardrails overview test for new component
Updates the expected header text to "Guardrails Settings" to match
GuardrailSettingsView's rendering, and moves the mock guardrails
from team_info.guardrails (legacy top-level path that nothing
reads) to team_info.metadata.guardrails where the component
actually looks. Also tightens the assertion to verify the
individual guardrail names appear, not just the section header.
2026-04-13 12:20:30 -07:00
Yuneng Jiang df75e79615 raise ValueError on os.environ/ references in request-supplied callback params
Previously these were silently dropped with a verbose warning, which
could break observability integrations without surfacing a clear error.
Now raises ValueError with remediation steps (configure server-side
or pass the resolved value) so callers get immediate, actionable feedback.
2026-04-13 12:00:25 -07:00
Ryan Crabbe 842523a918 chore(ui): use antd in GuardrailSettingsView and document the rule
Converts GuardrailSettingsView from @tremor/react (Badge, Text) to
antd (Tag, plain spans) as part of the Tremor migration. Also
captures the "no new Tremor imports" rule in CLAUDE.md and expands
the existing note in AGENTS.md with the specific antd equivalents
and the yellow→gold gotcha.
2026-04-13 11:49:39 -07:00
Ryan Crabbe 84d7816bc9 refactor(ui/team): extract GuardrailSettingsView and reuse across team views
Pulls the Global / Team-specific subsection rendering out of
TeamInfo.tsx into a shared GuardrailSettingsView component with
card and inline variants, used on both the team Overview tab
(inside the existing Tremor Card) and the Team Settings tab read
view. The Global subsection header now carries a GlobalOutlined
icon, and since the icon is load-bearing the edit-form chip
coloring is simplified to a single blue instead of green/blue.
2026-04-13 11:38:23 -07:00
yuneng-jiangandGitHub 26c35aa8eb Merge pull request #25594 from BerriAI/litellm_spend_logs_user_scoping
[Fix] /spend/logs: align filter handling with user scoping
2026-04-13 11:31:27 -07:00
Ryan Crabbe 1dcccfc1d1 feat(ui/team): show guardrails in team settings read view
The Team Settings tab's read view listed every team field except
guardrails. Adds a Guardrails entry after Status with the same
Global / Team-specific subsections used on the Overview tab, so
the kill switch state and per-section membership are visible
without entering edit mode.
2026-04-13 11:08:39 -07:00
Ryan Crabbe 6ae693b85c refactor(ui/team): split team read view guardrails into Global and Team-specific sections
Replaces the flat guardrails list with two subsections under the
Guardrails card, so the global vs. team-specific distinction is
carried by the section headers instead of per-badge markers. The
kill-switch state now renders in place of the Global subsection as
"Bypassed for this team", and the separate "Disable Global
Guardrails" field with its confusing "Disabled - Global guardrails
active" badge is removed.
2026-04-13 10:57:10 -07:00
Ryan Crabbe 1f57292363 fix(ui/team): add GlobalOutlined icon to global guardrail markers
Addresses a11y feedback — global vs. non-global guardrails were
distinguished only by color (green vs. blue). Adds GlobalOutlined
next to global guardrails in (1) the selected-chip tagRender, (2)
the dropdown OptGroup label, and (3) the team info read view badge.
2026-04-13 10:55:09 -07:00
d319cd8cc6 fix: blog dark mode - text invisible on dark background (#25620)
The blog CSS selectors for dark mode used descendant selectors like
[data-theme='dark'] .blog-wrapper which never matched because both
data-theme and .blog-wrapper are applied to the same <html> element
by Docusaurus. Fixed by using compound selectors (no space):
[data-theme='dark'].blog-wrapper.

Also added missing dark-mode overrides for:
- pre/code blocks in blog posts
- link colors in blog posts
- marquee items, separators, and labels on blog list page
- pagination links on blog list page
- meta text and author separators on blog list page

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
2026-04-13 09:08:57 -07:00
michelligabrieleandGitHub 0eae9f101e fix(auth): gate post-custom-auth DB lookups behind opt-in flag (#25634) 2026-04-13 08:02:16 -07:00
Sameer KankuteandGitHub 5e80e075c7 Merge pull request #25397 from BerriAI/litellm_oss_staging_04_08_2026
Litellm oss staging 04 08 2026
2026-04-13 09:12:40 +05:30
Sameer KankuteandGitHub fa605d85c0 Merge pull request #25616 from BerriAI/main
merge main
2026-04-13 08:43:43 +05:30
Yuneng Jiang d3331f855b refactor: rename filter var to satisfy mypy 2026-04-11 23:40:59 -07:00
Yuneng Jiang 4617d230f8 fix: hash sk- api_key in /spend/logs date-range path and add filter tests
Brings the date-range branch in line with the non-date-range branch which
already hashes sk- prefixed tokens before querying. Adds coverage for
filter-combination behavior in view_spend_logs.
2026-04-11 23:33:15 -07:00
Yuneng Jiang f5ce6cdd3b fix: align /spend/logs filter handling with user scoping 2026-04-11 23:22:05 -07:00
yuneng-jiangandGitHub fee4e71905 Merge pull request #25592 from BerriAI/litellm_tightenEnvReferenceHandling
[Fix] tighten handling of environment references in request parameters
2026-04-11 22:47:39 -07:00
Yuneng Jiang 41849a540d document new env var and fix type hint
- Add LITELLM_OIDC_ALLOWED_CREDENTIAL_DIRS to the environment variables
  reference so the documentation test passes.
- Annotate the values variable in _reject_os_environ_references so it
  accepts both dict.values() and list iterables.
2026-04-11 22:17:32 -07:00
Yuneng Jiang 6baee0dfcb address review feedback
- Log a warning when dropping callback params that carry os.environ/
  references so operators notice the misconfiguration.
- Require absolute paths in oidc/file/ and correct the documented
  example to use the leading-slash form.
- Drop the unused return value from _reject_os_environ_references.
2026-04-11 21:52:39 -07:00
Yuneng Jiang 06a0d4498a fix: tighten handling of environment references in request parameters
- Reject os.environ/ references supplied via /health/test_connection
  request params instead of resolving them; config-sourced values are
  already resolved before reaching the endpoint.
- Skip os.environ/ references in dynamic callback params loaded from
  per-request metadata.
- Constrain oidc/file/ to an allowed credential directory allowlist
  (defaults to /var/run/secrets and /run/secrets, overridable via
  LITELLM_OIDC_ALLOWED_CREDENTIAL_DIRS).
2026-04-11 21:41:41 -07:00
yuneng-jiangandGitHub 5544803b35 Merge pull request #25406 from BerriAI/litellm_regen_key_modal_antd
[Refactor] UI - Virtual Keys: migrate regenerate key modal to AntD
2026-04-11 21:27:09 -07:00
yuneng-jiangandGitHub 05e9ca7e75 Merge pull request #25541 from BerriAI/litellm_field_level_checks
[Fix] Align field-level checks in user and key update endpoints
2026-04-11 20:50:10 -07:00
Yuneng Jiang 1857be43a7 Merge remote-tracking branch 'origin/main' into litellm_regen_key_modal_antd 2026-04-11 20:45:17 -07:00
ishaan-berriandGitHub fdd7500904 blog: add back arrow to blog post pages (#25587)
* blog: add back arrow to post pages

* blog: style back arrow — fixed top-left below navbar
2026-04-11 19:15:45 -07:00
ishaan-berriandGitHub 1edf41c26f Merge pull request #25585 from BerriAI/litellm_dev_04_11_2026_p1
Litellm dev 04 11 2026 p1
2026-04-11 18:46:57 -07:00
Krrish Dholakia 973986aac2 docs: readme tweak 2026-04-11 18:34:23 -07:00
ishaan-berriandGitHub 329a526b9d Merge pull request #25579 from BerriAI/feat/anthropic-advisor-tool
feat(advisor): advisor tool orchestration loop for non-Anthropic providers
2026-04-11 18:32:44 -07:00
ishaan-berriandGitHub 12c1467228 Merge pull request #25583 from BerriAI/blog/ramp-style-restyle-with-redis-post
blog: Ramp-style engineering blog restyle + Redis circuit breaker post
2026-04-11 18:31:34 -07:00
Ishaan Jaffer dd87f3be5b docs(advisor): move supported providers to top, focus how it works on litellm native loop 2026-04-11 18:27:18 -07:00
Ishaan Jaffer a8bc7bfcd4 docs(advisor): add how it works section with mermaid diagram + non-native provider table 2026-04-11 18:23:33 -07:00
Ishaan Jaffer 9be7b4c07c test(advisor): add integration tests for full dispatch path, max_uses, provider bypass 2026-04-11 18:16:56 -07:00
Ishaan Jaffer fa5258466d test(advisor): add unit tests for max_uses=0, missing model, default fallback 2026-04-11 18:16:56 -07:00