mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
Three issues flagged by automated PR review (greptile-apps, veria-ai), all confirmed real and reproduced before fixing: 1. [High/Security] Team-owned deployments entered the global canonical index unconditionally. A no-team (unrestricted) key could request an unclaimed spelling of a model (e.g. the dated Anthropic ID) whose only server was a team's private deployment, resolve onto it, and use that team's credentials/quota -- target-authorization passes for unrestricted keys and doesn't itself re-derive team ownership. Fixed by excluding any deployment with model_info.team_id set from the index entirely: a team boundary is an access/billing boundary exactly like the cross-provider boundary this module already respects, and team-scoped models remain reachable exactly as before, via team_public_model_name through the existing team-route machinery this module never touches. 2. [P1] Sentinel collision defeated the ambiguity guard: index.get(key, '__absent__') treated a model group literally named '__absent__' as a missing entry, so a second group with the same identity would silently overwrite it instead of triggering the ambiguity decline. Fixed with a proper 'in' check. 3. [P2] Log deduplication was keyed on target alone, so a second distinct requested spelling resolving to an already-logged target never got its own log line -- undercounting the (requested, target) cardinality that's the whole point of the observability story (sizing follow-up-resolution demand). Now keyed on the (requested, target) pair. Added 5 regression tests reproducing each bug pre-fix and asserting the fixed behavior. Full affected suite: 522 passed. router_code_coverage: 0.0% untested. ruff-strict BLE001/PERF401: unchanged at base parity. basedpyright: new module 0 errors. Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| pre_call_checks | ||
| test_add_retry_fallback_headers.py | ||
| test_auto_router_model_naming.py | ||
| test_cooldown_cache.py | ||
| test_cooldown_handlers.py | ||
| test_fallback_event_handlers.py | ||
| test_health_check_allowed_fails_integration.py | ||
| test_health_state_cache.py | ||
| test_router_canonical_model_resolution.py | ||
| test_router_health_check_routing.py | ||
| test_router_interactions_endpoints.py | ||
| test_router_utils_common_utils.py | ||