From c9259e4bf2b850ecc8b7cea90313422ff010b6c0 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Sat, 11 Jul 2026 09:44:31 -0700 Subject: [PATCH] fix(auth): tolerate request objects without path_params in common_checks The PATCH /team/{team_id} org-context wiring reads request.path_params to resolve the team id from the path. A real Starlette Request always exposes path_params, but common_checks is exercised with lightweight request doubles that don't, which raised AttributeError. Read it defensively so a missing or null path_params falls back to no path team id, matching the "not a bare team route" outcome; real requests are unaffected --- litellm/proxy/auth/auth_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/auth/auth_checks.py b/litellm/proxy/auth/auth_checks.py index fab0338c7a8..1db5e2f5724 100644 --- a/litellm/proxy/auth/auth_checks.py +++ b/litellm/proxy/auth/auth_checks.py @@ -726,7 +726,7 @@ async def common_checks( route=route, request_body=request_body, fetch_team_org_id=_fetch_team_org_id, - path_team_id=request.path_params.get("team_id"), + path_team_id=(getattr(request, "path_params", None) or {}).get("team_id"), ) _is_route_allowed = _is_api_route_allowed(