Commit Graph
32985 Commits
Author SHA1 Message Date
Sameer KankuteandGitHub bf024c0404 Merge pull request #21654 from BerriAI/litellm_new_gemini_pathc
Fix _map_reasoning_effort_to_thinking_level for all gemini 3 family
2026-02-20 18:14:47 +05:30
yuneng-jiangandGitHub 527f5c5d14 Merge pull request #21657 from BerriAI/litellm_knip_unused_files_cleanup
[Refactor] UI: Remove 38 unused files detected by knip
2026-02-19 22:22:21 -08:00
yuneng-jiangandClaude Opus 4.6 eeab8705a1 [Refactor] UI: Remove 38 unused files detected by knip
Dead code cleanup — these files had no imports from any active entry points.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 22:07:41 -08:00
Sameer Kankute 5885c4a588 Fix _map_reasoning_effort_to_thinking_level for all gemini 3 family 2026-02-20 11:17:24 +05:30
jquinterandGitHub 37c98f8325 Merge pull request #21602 from BerriAI/fix/policy-endpoints-unused-import
fix(lint): remove redundant router import in policy_endpoints __init__
2026-02-20 01:16:18 -03:00
jquinterandGitHub d08c3a1d68 Merge pull request #21638 from BerriAI/fix/ai-policy-suggester-use-litellm-acompletion
fix(policy): use litellm.acompletion directly in AiPolicySuggester
2026-02-20 01:14:59 -03:00
jquinterandGitHub 898774fecf Merge pull request #21643 from BerriAI/fix/redis-cache-test-missing-host
fix(tests): pass host to RedisCache in test_team_update_redis
2026-02-20 01:11:04 -03:00
Sameer KankuteandGitHub fb75a7130f Merge pull request #21630 from Chesars/fix/empty-system-message-anthropic
fix(anthropic): empty system messages in translate_system_message
2026-02-20 09:32:50 +05:30
Julio Quinteros ProandClaude Sonnet 4.6 bd8c1cc673 fix(tests): pass host to RedisCache in test_team_update_redis to avoid ValueError
RedisCache() without arguments fails at construction with
"ValueError: Either 'host' or 'url' must be specified for redis."
The actual Redis connection is irrelevant since async_set_cache is mocked.
Unlike test_get_team_redis which uses client_no_auth (which sets REDIS_HOST
via fake_env_vars), test_team_update_redis has no fixture setting that env var.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 01:00:58 -03:00
jquinterandGitHub 6b681aafdd Merge pull request #21641 from BerriAI/fix/jwt-tests-missing-premium-user-flag
fix(tests): set premium_user=True in JWT tests that call user_api_key_auth
2026-02-20 00:45:13 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 cde51a53a7 fix(tests): set premium_user=True in JWT tests that call user_api_key_auth
JWT auth is an enterprise-only feature. Tests that call user_api_key_auth
with enable_jwt_auth=True must set premium_user=True on the proxy server
to bypass the enterprise gate, otherwise they fail with:

  ValueError: JWT Auth is an enterprise only feature.

This follows the same pattern as PR #21285 (fix/jwt-enterprise-license-test).

Fixed tests:
- test_team_token_output
- test_allowed_routes_admin
- test_allow_access_by_email
- test_end_user_jwt_auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 00:31:56 -03:00
jquinterandGitHub 2b09c5d3bc Merge pull request #21639 from BerriAI/fix/unused-imports-semantic-guard-and-policy-endpoints
fix(lint): remove unused imports in semantic_guard and policy_endpoints
2026-02-20 00:02:21 -03:00
Sameer KankuteandGitHub b405f64688 Merge pull request #21598 from jtsaw/fix/anthropic-sonnet-4-6-reasoning-effort
support reasoning and effort parameters on sonnet 4.6
2026-02-20 08:24:29 +05:30
Julio Quinteros ProandClaude Sonnet 4.6 dba60cac22 fix(lint): remove unused imports in semantic_guard and policy_endpoints
- Remove unused RouteChoice import from semantic_guard.py TYPE_CHECKING block
  (only referenced in docstring, never used as a type annotation)
- Remove redundant explicit router import from policy_endpoints/__init__.py
  (already re-exported by the preceding import * on the same line)

Fixes Ruff F401 errors caught in CI linting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 23:46:02 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 3381d6217f fix(policy): use litellm.acompletion directly in AiPolicySuggester
The suggest() method was calling llm_router.acompletion(), which requires
the proxy router to be initialised. This caused:
  ValueError: LLM router not initialized
in every test (and in any deployment without a configured router).

AiPolicySuggester is a self-contained feature that calls an LLM directly;
it has no need for proxy routing. Switch to litellm.acompletion, which is
always available and is what the tests already mock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 23:35:35 -03:00
0f2516e9cd fix: handle explicit None model_info in LowestLatencyLoggingHandler (#21633)
When model_info is explicitly set to None in litellm_params (via
get_litellm_params.py), the pattern .get("model_info", {}) returns
None instead of {}, causing AttributeError on the chained .get("id").

This commonly occurs when Anthropic API returns usage limit errors,
the router falls back to Vertex AI, and the fallback succeeds — the
log_success_event callback fires with model_info=None.

Uses the (x or {}) pattern already established in router.py.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 17:30:58 -08:00
Ishaan Jaffer d2bdf7d618 fix form 2026-02-19 17:17:20 -08:00
Ishaan Jaffer be16f320ac fix filter 2026-02-19 17:17:11 -08:00
Ishaan Jaffer 2199b0783d ui refactor 2026-02-19 17:13:51 -08:00
Ishaan Jaffer 35120515cb QA: UI fix test page 2026-02-19 17:13:51 -08:00
yuneng-jiangandGitHub aa9f85545c Merge pull request #21627 from BerriAI/litellm_service_key_vis
[Fix] Service Account Visibility for Team Members
2026-02-19 17:09:33 -08:00
yuneng-jiang 4475258426 address greptile review feedback (greploop iteration 1)
Refactor to fetch team objects once via _fetch_user_team_objects(),
then derive admin and member team IDs from the shared result. Eliminates
duplicate DB query between get_admin_team_ids and get_member_team_ids.
2026-02-19 16:53:48 -08:00
Chesars 56386969b5 fix(anthropic): remove empty system messages from message list
Empty system messages were skipped for Anthropic's system param but
not removed from the messages list, causing BadRequestError when
anthropic_messages_pt encountered the unsupported "system" role.

Fixes #21622
2026-02-19 21:46:17 -03:00
yuneng-jiang c7fe400d4d [Fix] Service account visibility for team members
Regular team members could not see service accounts belonging to their
team. Additionally, former team members could still see service accounts
they created via the created_by filter after leaving the team.

- Add get_member_team_ids() to retrieve all teams a user belongs to
- Regular members now see team service accounts (user_id=NULL) but not
  other members' personal keys
- Scope created_by filter to the user's current team memberships
- Add 7 unit tests covering the new visibility rules
2026-02-19 16:29:43 -08:00
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
2d39825868 chore: regenerate poetry.lock to match pyproject.toml (#21626)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-20 00:25:50 +00:00
jquinterandGitHub 30a6b18c0d Merge pull request #21625 from BerriAI/fix/regenerate-lock-drop-pat-approval
fix(ci): drop PAT_TOKEN_2 approval, use github.token for auto-merge
2026-02-19 21:20:02 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 11d0fca0de fix(ci): drop PAT_TOKEN_2 approval step, use github.token for auto-merge
PAT_TOKEN_2 does not have the scope for addPullRequestReview.
github.token cannot approve its own PR either, so drop the approval
step entirely. Auto-merge with github.token is enough: the PR will
merge automatically once required CI checks pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 21:17:40 -03:00
jquinterandGitHub 3a51d8bcb5 Merge pull request #21619 from BerriAI/fix/regenerate-lock-auto-approve
feat(ci): auto-approve and auto-merge the regenerated poetry.lock PR
2026-02-19 21:03:16 -03:00
Ishaan Jaffer d4ae3c8370 ui new build 2026-02-19 15:57:19 -08:00
Ishaan JaffandGitHub 655973e8c8 feat(ui): show latency overhead for AI-suggested policy templates (#21620)
* feat(policy): add estimated_latency_ms to all policy templates

* feat(policy): add estimated_latency_ms to backup templates

* feat(ui): show latency overhead badge in AI policy suggestions
2026-02-19 15:45:07 -08:00
Julio Quinteros ProandClaude Sonnet 4.6 41776b0382 feat(ci): auto-approve and auto-merge the regenerated poetry.lock PR
Now that "Allow GitHub Actions to create and approve pull requests" is
enabled in repo settings:
- PR creation uses github.token (no secret needed)
- Approval uses PAT_TOKEN_2 (GitHub requires a different identity from
  the PR creator to approve)
- Auto-merge is enabled with --squash so the PR merges as soon as
  required checks pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 20:23:07 -03:00
jquinterandGitHub c32892dd46 Merge pull request #21618 from BerriAI/fix/regenerate-lock-pr-token
fix(ci): use PAT_TOKEN_2 for gh pr create in regenerate-lock workflow
2026-02-19 20:16:49 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 9c70cd615a fix(ci): use PAT_TOKEN_2 for gh pr create
github.token cannot open PRs when "Allow GitHub Actions to create and
approve pull requests" is disabled in repo settings. PAT_TOKEN_2
bypasses that restriction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 20:13:58 -03:00
jquinterandGitHub b88ecb11f0 Merge pull request #21617 from BerriAI/fix/regenerate-lock-no-update-flag
fix(ci): remove --no-update flag removed in Poetry 2.x
2026-02-19 20:09:57 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 08b5907c9c fix(ci): remove --no-update flag removed in Poetry 2.x
The workflow fails with:
  The option "--no-update" does not exist

--no-update was removed in Poetry 2.x. Plain `poetry lock` is the
correct equivalent — it re-solves only what pyproject.toml requires
without upgrading already-locked packages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 20:07:14 -03:00
Ishaan JaffandGitHub 3d8c042ca5 feat: prompt injection guardrail policy template (#21520)
* add semantic guard constants

* add SEMANTIC_GUARD enum value

* add keyword-based prompt injection policy template

* add semantic prompt injection route template

* add semantic guard route loader

* add semantic guard guardrail

* add semantic guard registration

* add semantic guard tests

* enhance SQL injection keyword category with more patterns and exceptions

* add standalone SQL injection policy template

* add SQL injection semantic guard route template

* add SQL injection guardrail tests

* remove standalone sql_injection policy template, use categories/prompt_injection_sql.yaml instead
2026-02-19 15:06:06 -08:00
jquinterandGitHub 1edd6459b3 Merge pull request #21616 from BerriAI/fix/regenerate-lock-token-fallback
fix(ci): fall back to github.token when GH_TOKEN secret is not set
2026-02-19 20:01:46 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 54470ec1d9 fix(ci): use github.token with explicit permissions instead of PAT secret
Drop the PAT_TOKEN_2 secret (whose scope is unknown) in favour of the
built-in github.token, which is always available. Grant it exactly the
two permissions it needs:
  - contents: write      → push the auto/regenerate-* branch
  - pull-requests: write → open the PR via gh cli

No external secret needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:56:59 -03:00
Julio Quinteros Pro 8cc50d6736 chore: fix stale GH_TOKEN comment 2026-02-19 19:55:44 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 e590674083 fix(ci): use PAT_TOKEN_2 instead of non-existent GH_TOKEN secret
GH_TOKEN is not configured in this repository. The correct PAT secret
is PAT_TOKEN_2, which has the permissions needed to push branches and
open PRs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:55:33 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 755dd46d45 fix(ci): fall back to github.token when GH_TOKEN secret is not set
When secrets.GH_TOKEN is not configured, the workflow fails immediately with:
  "Input required and not supplied: token"

Using || github.token ensures a valid token is always available.
GH_TOKEN (PAT) is preferred when set; github.token is used as fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:52:01 -03:00
jquinterandGitHub a6af0425ea Merge pull request #21615 from BerriAI/fix/regenerate-poetry-lock-yaml-syntax
fix(ci): fix YAML syntax error in regenerate-poetry-lock workflow
2026-02-19 19:47:36 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 8edc6effb1 fix(ci): fix YAML syntax error in regenerate-poetry-lock workflow
A heredoc inside \$() inside a double-quoted string inside a YAML multiline
run block breaks the YAML parser at line 60. Replaced with: write the PR
body to /tmp/pr-body.md using a standalone heredoc, then pass it via
gh pr create --body-file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:45:14 -03:00
jquinterandGitHub f106c97bf2 Merge pull request #21609 from BerriAI/fix/delete-keys-return-failed-tokens
fix(key management): return failed_tokens in delete_verification_tokens response
2026-02-19 19:31:39 -03:00
jquinterandGitHub b32ba5902b Merge pull request #21610 from BerriAI/fix/auto-regenerate-poetry-lock
ci: auto-regenerate poetry.lock when pyproject.toml changes on main
2026-02-19 19:29:08 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 b9f36645f3 fix(key management): populate failed_tokens for admin partial-delete path
The admin bulk-delete path (prisma_client.delete_data) was never comparing
the DB return value against the requested tokens, so failed_tokens was
always empty for admins even when the DB silently skipped some tokens.

Adds the same mismatch check as the non-admin path, and a new test that
exercises admin bulk-delete returning fewer tokens than requested.

Fixes gap identified by Greptile review on #21609.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:28:03 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 b9e79cc07b fix(ci): restrict GITHUB_TOKEN to contents:read via explicit permissions block
GitHub Advanced Security flagged that the workflow had no permissions block,
leaving GITHUB_TOKEN with its default broad scope. All write operations
(git push, gh pr create) already use GH_TOKEN (PAT), so the implicit
GITHUB_TOKEN only needs read access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:24:57 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 5681229e7c fix(ci): force-push bot branch to handle pre-existing branch from prior run
A re-run within the same second (or a leftover branch) would cause
`git push` to fail. Adding -f is safe since this is a bot-owned branch
that is immediately turned into a PR and never used for anything else.

Fixes inline suggestion from Greptile review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:20:01 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 dfbf14e626 fix(ci): pass GH_TOKEN to checkout so git push can create the branch
Without the token in the checkout step the subsequent `git push` uses the
default GITHUB_TOKEN which lacks permission to push new branches, causing
the workflow to fail silently. Fixes issue flagged by Greptile review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:18:18 -03:00
Julio Quinteros ProandClaude Sonnet 4.6 d7d651dfeb ci: auto-regenerate poetry.lock when pyproject.toml changes on main
Adds a workflow that triggers whenever pyproject.toml is merged into main
and opens a PR with the refreshed lock file, fixing the recurring CI failure:
"pyproject.toml changed significantly since poetry.lock was last generated."

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 19:13:54 -03:00