Skip to content

[litellm-agent] Staging → litellm_internal_staging (5/7/2026) - #27359

Closed
oss-pr-review-agent-shin[bot] wants to merge 0 commit into
litellm_internal_stagingfrom
litellm_agent_oss_staging_05_07_2026
Closed

[litellm-agent] Staging → litellm_internal_staging (5/7/2026)#27359
oss-pr-review-agent-shin[bot] wants to merge 0 commit into
litellm_internal_stagingfrom
litellm_agent_oss_staging_05_07_2026

Conversation

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor

Automated staging PR created by litellm-agent.

This branch collects PRs approved by the agent on 5/7/2026.

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.25490% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ellm/proxy/_experimental/mcp_server/oauth_utils.py 87.23% 6 Missing ⚠️
...itellm/proxy/health_endpoints/_health_endpoints.py 68.42% 6 Missing ⚠️
litellm/proxy/auth/handle_jwt.py 88.88% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@greptile-apps

greptile-apps Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This automated staging PR bundles five independently-reviewed fixes: OAuth redirect-URI validation extended to same-origin (UI callback flow), JWT team-ID claim union for Okta/Auth0 single-team users, guardrail provenance tracking for cross-pod stale-entry reconciliation, deployment disambiguation by model_info.id in the health test-connection endpoint, and a server-side-filtering refactor for the Virtual Keys table.

  • MCP OAuth (oauth_utils.py, discoverable_endpoints.py): validate_trusted_redirect_uri replaces the loopback-only guard, adding same-origin acceptance for the proxy's own UI callback while preserving loopback for native MCP clients. get_request_base_url is de-duplicated into oauth_utils; X-Forwarded-* headers are only trusted from configured proxy ranges.
  • JWT + Guardrails (handle_jwt.py, guardrail_registry.py, guardrail_endpoints.py, proxy_server.py): get_all_jwt_team_ids unions both plural and singular IdP claim fields; the guardrail registry gains a _sources provenance map and reconcile_db_guardrails to purge entries deleted on another pod, with list/get-by-id endpoints updated to surface correct 404s for stale in-memory rows.
  • Frontend (VirtualKeysTable.tsx, filter_logic.tsx, model_info_view.tsx): filtering delegated from the client-side hook to the useKeys query params, with 300 ms debounce and page-reset on filter change; model_info.id now forwarded to the test-connection endpoint to disambiguate wildcard multi-deployment models.

Confidence Score: 5/5

Safe to merge — all changed paths are well-scoped, thoroughly mocked, and guarded by new regression tests.

Each change is narrow in scope with direct test coverage. The OAuth redirect validation tightens the trust boundary; the JWT union is additive only; the guardrail provenance system correctly segregates config from DB entries and never removes config-loaded guardrails during reconciliation; the health endpoint disambiguates only when an id is explicitly supplied. No backwards-incompatible interface changes, no direct DB queries in new hot paths, and all new tests are properly mocked.

No files require special attention.

Important Files Changed

Filename Overview
litellm/proxy/_experimental/mcp_server/oauth_utils.py Adds get_request_base_url (moved from discoverable_endpoints) and validate_trusted_redirect_uri that accepts same-origin or loopback URIs; X-Forwarded-* headers only honoured from trusted proxy ranges
litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py Replaces loopback-only redirect_uri validation with validate_trusted_redirect_uri; callback now receives Request param for same-origin origin check; get_request_base_url de-duplicated into oauth_utils
litellm/proxy/auth/handle_jwt.py Adds get_all_jwt_team_ids that unions plural (team_ids_jwt_field) and singular (team_id_jwt_field) claims, deduplicated, without consulting team_id_default
litellm/proxy/guardrails/guardrail_registry.py Adds _sources provenance dict (db/config), get_source(), and reconcile_db_guardrails() to drop stale cross-pod DB entries; source param threads through initialize/update/reinitialize paths
litellm/proxy/guardrails/guardrail_endpoints.py list_guardrails_v2 skips DB-backed in-memory entries absent from DB query; get_guardrail_info returns 404 for stale DB-backed entries; create/approve calls pass source=db
litellm/proxy/health_endpoints/_health_endpoints.py test_model_connection now disambiguates by model_info.id (get_deployment) first, falling back to model_name lookup; fixes silent use of deployments[0] for wildcard multi-deployment models
litellm/proxy/proxy_server.py _init_guardrails_in_db now collects db_guardrail_ids set and calls reconcile_db_guardrails after syncing, purging stale entries deleted on another pod
litellm/proxy/management_endpoints/ui_sso.py SSO callback now calls get_all_jwt_team_ids instead of get_team_ids_from_jwt in two places, picking up both singular and plural claim fields
ui/litellm-dashboard/src/components/VirtualKeysPage/VirtualKeysTable.tsx Moves filtering from client-side (filter_logic hook) to server-side (useKeys params); debounces filter inputs before API calls; pagination resets on filter change
ui/litellm-dashboard/src/components/key_team_helpers/filter_logic.tsx Simplified to pure filter-state management; removes debouncedSearch API call, filteredKeys, filteredTotalCount, Sort By/Sort Order fields; adds Key Hash field
ui/litellm-dashboard/src/components/model_info_view.tsx Passes model_info.id in the test-connection request payload so the backend can disambiguate between deployments sharing a wildcard model_name
litellm/proxy/guardrails/init_guardrails.py Passes source=config when initializing guardrails from YAML config file

Reviews (2): Last reviewed commit: "fix(ui): virtual keys filter silently re..." | Re-trigger Greptile

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

@oss-pr-review-agent-shin

Copy link
Copy Markdown
Contributor Author

@greptile please review

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.

0 participants