chore(release): patch v1.88.0-rc.1 with four staged fixes - #29632
Conversation
* fix(proxy): resolve managed video model ids for auth Co-authored-by: Cursor <cursoragent@cursor.com> * test(proxy): cover character_id router model resolution Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit d45e9e4)
…ams (#29310) * fix(key_generate): allow team members to create keys on org-scoped teams When a virtual key is created for a team, enterprise logic inherits the team's organization_id onto the key (add_team_organization_id). Since the VERIA-55 org-IDOR fix, /key/generate then required the caller to be an explicit LiteLLM_OrganizationMembership member of that org, returning 403 "Caller is not a member of organization_id=<uuid>". Admins normally only add users to teams (not orgs), so self-serve key creation regressed for any user on an org-scoped team (regression since v1.84.0-rc.1). Skip the org-membership check when organization_id was inherited from the key's team (organization_id == team_table.organization_id). Team-level authorization already gates this path, so team membership is sufficient. The membership check still runs when a caller assigns an organization_id that did not come from the key's team, preserving the IDOR protection. Adds regression tests covering both the team-inherited (allowed) and foreign-org (still blocked) cases. Co-authored-by: Cursor <cursoragent@cursor.com> * test(key_generate): cover mismatched team org IDOR path on generate Add test_generate_key_foreign_org_with_mismatched_team_still_enforces_membership for the case where a team is present but request organization_id differs from team_table.organization_id. Enterprise inheritance is no-op'd in the test so the guard is exercised directly; membership validation must still run. Addresses Greptile review on #29310. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit b11833c)
… reject it (Haiku 4.5) (#29585) * fix(vertex): strip output_config.effort for models that reject it Haiku 4.5 on Vertex AI does not support output_config.effort and 400s with "output_config.effort: Extra inputs are not permitted". PR #27074 emptied VERTEX_UNSUPPORTED_OUTPUT_CONFIG_KEYS so effort would forward for Opus/Sonnet 4.6+, but that made the strip unconditional across every Vertex Anthropic model, including ones that don't support it. Claude Code injects effort into its default Messages payload, so `claude --model claude-haiku-4.5` started failing. Make the sanitizer model-aware: drop output_config.effort for models that don't advertise output_config support (or any reasoning effort level) while forwarding it for those that do. The fix covers both the chat-completion and Messages pass-through transformation paths since they share the helper. * chore(vertex): log at debug when dropping unsupported output_config.effort Operators pointing an unregistered Vertex Claude alias that does support effort would otherwise see it stripped with no signal. Debug level keeps it out of normal logs since Claude Code sends effort on every request. (cherry picked from commit cc55662)
* fix duplicate cost callbacks for anthropic streaming pass-through Two bugs caused _PROXY_track_cost_callback to see stream=True + complete_streaming_response=None on every streaming pass-through request, making the dedup guard in dispatch_success_handlers permanently inactive: 1. pass_through_endpoints.py created the Logging object with stream=False for all requests. _is_assembled_stream_success short-circuits on self.stream is not True, so has_dispatched_final_stream_success was never set and any second dispatch went through unchecked. Fix: set logging_obj.stream = True after stream detection. 2. _create_anthropic_response_logging_payload set complete_streaming_response inside the try block after litellm.completion_cost(), so a pricing error caused an early return without setting it on model_call_details. Fix: set complete_streaming_response before the try block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix stream * add stream to logging obj * test(pass_through): give mock logging object a real model_call_details dict The anthropic passthrough logging payload now records the assembled response on model_call_details before cost calculation, which requires model_call_details to support item assignment. In production it is always a dict; the existing unit test stubbed the logging object with a bare Mock whose attribute is not subscriptable, so the new assignment raised TypeError. Use a real dict to match the production logging object. * test(pass_through): cover streaming logging-obj stream flag The streaming branch of pass_through_request that marks the logging object as streaming (logging_obj.stream and model_call_details["stream"]) had no unit coverage, so the patch coverage gate flagged it. Add a regression test that drives a streaming pass-through request through pass_through_request and asserts the logging object is flagged as a stream before dispatch. * test(pass_through): cover SSE-response stream flag fallback branch The auto-detected streaming branch of pass_through_request (when a request that was not flagged as streaming returns a text/event-stream response) sets logging_obj.stream and model_call_details["stream"] but had no unit coverage, so the codecov patch gate failed at 60%. Drive a non-streaming pass-through request whose upstream response is SSE through pass_through_request and assert the logging object is flagged as a stream before dispatch. * fix(pass_through): gate complete_streaming_response on stream flag perform_redaction only scrubs complete_streaming_response when model_call_details["stream"] is True. Setting it unconditionally for non-streaming Anthropic pass-through responses left the assembled response unredacted in model_call_details, which is handed to logging callbacks as kwargs when message logging is disabled. Only record it for actual streaming responses so redaction always applies. --------- Co-authored-by: mubashir1osmani <mubashir.osmani777@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> (cherry picked from commit 2bbdbfa)
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis is a patch release cherry-picking four bug fixes from
Confidence Score: 4/5All four cherry-picked fixes are narrowly scoped and have accompanying unit tests; no migration or schema changes; the auth and key-management changes handle edge cases defensively. The video-ID router threading touches the auth hot path at multiple call sites, which warrants careful review even though each individual change is small. The org-membership bypass in key generation is correctly gated on a DB-fetched team record, and tests verify both the bypass and the enforcement paths. The streaming dedup fix is clean and the new test class exercises the pre-fix broken state explicitly. No issues were found that would prevent merging. litellm/proxy/auth/user_api_key_auth.py (six call sites updated) and litellm/proxy/management_endpoints/key_management_endpoints.py (org-membership bypass logic)
|
| Filename | Overview |
|---|---|
| litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/output_params_utils.py | Adds model-aware effort stripping using the model map; compliant with model-hardcoding rule |
| litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/experimental_pass_through/transformation.py | Passes model (popped from request body) to sanitize helper; model may be None if body omits it, but Anthropic Messages API always includes model |
| litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py | Forwards the existing model parameter to sanitize helper; no issues |
| litellm/proxy/auth/auth_utils.py | Adds llm_router threading for video/character ID resolution; new helper gracefully handles None router/model_id |
| litellm/proxy/auth/user_api_key_auth.py | Propagates llm_router to all _get_model_from_request_context call sites; mechanical and consistent |
| litellm/proxy/auth/auth_checks.py | Single-line addition forwarding llm_router to common_checks; no issues |
| litellm/proxy/management_endpoints/key_management_endpoints.py | _org_inherited_from_team bypass is DB-backed (team_table fetched with check_db_only=True); security boundary looks correct |
| litellm/proxy/pass_through_endpoints/llm_provider_handlers/anthropic_passthrough_logging_handler.py | complete_streaming_response gated on stream flag; prevents dedup bypass for non-streaming redaction path |
| litellm/proxy/pass_through_endpoints/pass_through_endpoints.py | Sets stream=True on logging_obj at both the explicit-stream and SSE-fallback branches before chunk processing |
| litellm/proxy/spend_tracking/budget_reservation.py | Passes llm_router to get_model_from_request for budget reservation and cost estimation; consistent with auth changes |
| tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py | Three new tests cover the bypass case, no-team case, and mismatched-team case for org-membership check; good coverage |
| tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py | New test classes cover streaming dedup guard and non-streaming redaction path; thorough regression coverage |
| tests/test_litellm/proxy/auth/test_auth_utils.py | Two new tests cover router resolution for video_id and character_id fields; appropriate mock-only unit tests |
Reviews (1): Last reviewed commit: "fix: passthrough endpoints duplicate log..." | Re-trigger Greptile
Relevant issues
Patches the cut
v1.88.0-rc.1tag with the staged fixes that landed onlitellm_internal_stagingafter the rc was branched, so the next rc carries them. The base branchpatch/v1.88.0-rc.1is cut from thev1.88.0-rc.1tag, mirroring thepatch/v1.87.0-rc.1flowLinear ticket
N/A
What is included
Cherry-picked in merge order:
output_config.effortfor Vertex Claude models that reject it, such as Haiku 4.5#28627 and #29264 are not here because rc.1 already carries them. All four apply cleanly with no conflicts since rc.1 is close to internal_staging. There is no version bump: the 1.88 line keeps
pyproject.tomlat 1.88.0 and the rc number is a git tag, which matches how 1.87.0-rc.2 was cutPre-Submission checklist
make test-unitCI (LiteLLM team)
Link:
Link:
Links:
Screenshots / Proof of Fix
These are backports of changes already merged and validated on internal_staging; each linked PR carries its own proof and review
Type
Bug Fix
Changes
See the commit list above. No new code beyond the cherry-picks