fix(proxy): make /cursor/chat/completions work with Cursor agent mode - #34029
Conversation
Greptile SummaryThis PR fixes a cluster of real failures in the
Confidence Score: 5/5Safe to merge. The behavioral changes are narrow: the cursor endpoint was broadly broken before, the bridge routing change only affects the default OpenAI and Azure endpoints (custom API bases are explicitly exempted), and the custom tool call additions are additive to existing union types without touching function tool call serialization. All changed paths are covered by new mock-based unit tests including the full envelope x format normalization matrix, streaming conversion, and api_base resolution logic with monkeypatching. The two tests whose assertions were inverted correctly encode the new required behavior. No regressions found in function tool call serialization or streaming paths. Files Needing Attention: The completion_extras/litellm_responses_transformation/transformation.py streaming converter warrants a careful read, particularly the tool_call_index_map per-stream state and the output_item.done split between stateless and per-stream callers.
|
| Filename | Overview |
|---|---|
| litellm/proxy/response_api_endpoints/endpoints.py | Significant refactor: cursor endpoint now branches on body shape (chat vs. Responses-shaped), adds per-level tool dialect normalization helpers, and fixes streaming (generator signature + __anext__ detection). New cursor_model_list routes to the standard model list. The stream_options rebuild (instead of pop) correctly avoids corrupting the request cache. |
| litellm/main.py | Adds _resolve_openai_api_base shared helper so the bridge heuristic and the chat handler resolve the effective endpoint identically. Bridge now auto-activates for gpt-5.4+ with function tools + unset reasoning_effort on the default OpenAI/Azure endpoint, and correctly exempts custom API bases. reasoning_effort 'none' remains the documented escape hatch. |
| litellm/completion_extras/litellm_responses_transformation/transformation.py | Complex streaming/non-streaming fixes: custom_tool_call items now produce tool_call deltas; tool-call indices are remapped 0-based per-stream; response.completed fires finish_reason=tool_calls for custom_tool_call; GenericResponseOutputItem (pydantic) no longer raises 'Unknown items'; tool_choice translation extended for custom type. |
| litellm/types/utils.py | New sibling types ChatCompletionMessageCustomToolCall / ChatCompletionDeltaCustomToolCall with shared dispatch via chat_completion_tool_call_from_dict and is_custom_tool_call_dict; Delta.init now dispatches on the custom key for streaming. Message.tool_calls union type expanded. |
| litellm/litellm_core_utils/streaming_chunk_builder_utils.py | ChunkProcessor accumulates custom.input fragments alongside function.arguments; finalized custom tool calls build ChatCompletionMessageCustomToolCall. Arguments accumulation converted from list.append to tuple concatenation (immutable). |
| litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py | All three tool-call construction sites now route through chat_completion_tool_call_from_dict. _handle_invalid_parallel_tool_calls and _should_convert_tool_call_to_json_mode guard against custom entries. |
| litellm/integrations/helicone.py | Tool call logging now falls back to custom.name/custom.input when function is absent. Skips entries without either payload to avoid KeyError. |
| litellm/integrations/lunary.py | parse_tool_calls filters out entries with neither function nor custom payload; clean_tool_call dispatches on custom attribute. |
| tests/test_litellm/test_main.py | Two existing bridge-check tests renamed and assertions inverted to reflect the intentional behavior change. Many new parametrized tests added including api_base/env-var scenarios with monkeypatch. |
| tests/test_litellm/proxy/response_api_endpoints/test_endpoints.py | 629 lines of new tests for the cursor endpoint: TestClient-based, mocked dependencies, covers messages vs. input routing, tool normalization matrix, streaming, cache non-corruption, and model list endpoints. |
Reviews (18): Last reviewed commit: "chore(lint): use a PEP 604 union for the..." | Re-trigger Greptile
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
CI note: the osv-scan red on this PR is inherited, not from this diff. GHSA-3jxr-9vmj-r5cp (brace-expansion 5.0.6, npm dev dep of the dashboard) entered the OSV database between this PR's first and second runs; the same lockfile passed at 20:15 and failed at 21:00 with no dependency changes in between. Fix is in #34032, which bumps the single lockfile entry to 5.0.7; osv-scan here will go green once that merges into litellm_internal_staging and this branch rebases or the check re-runs against the updated database expectations |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit def8a2c. Configure here.
1 similar comment
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 897e1bd. Configure here.
2 similar comments
|
bugbot run |
1 similar comment
0f754e3 to
af78454
Compare
|
bugbot run |
1 similar comment
|
Addressed the 4/5 concern about gpt-5.4+ names on non-OpenAI backends in 2cd909a, with self-scoping instead of a config flag: the unset-effort arm now fires only against endpoints known to enforce the OpenAI constraint (default OpenAI endpoint, or Azure where api_base is always set), so chat-only OpenAI-compatible backends with custom api_base keep their pre-existing behavior exactly (bridge only on an explicit reasoning_effort, escape hatch reasoning_effort none unchanged). Pinned by three new tests: custom api_base with unset effort stays chat, custom api_base with explicit effort still bridges, azure with api_base and unset effort bridges; mutation-checked. |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit eea9bb1. Configure here.
…sor/chat/completions Cursor appends -thinking-<level> and -fast to custom model names when the user picks a thinking level or fast mode, so a model configured as claude-opus-5 arrives as claude-opus-5-thinking-xhigh-fast and fails routing with no healthy deployments. When the raw name is not servable by the router but the suffix-stripped base name is, rewrite the body to the base model and carry the thinking level into reasoning_effort (chat bodies) or reasoning.effort (Responses bodies), never clobbering an effort the client already sent. Explicitly configured aliases keep winning because the raw-name servability check runs first.
|
The version parse predates this PR and degrades gracefully for dated snapshots and future minors. A per-entry json flag would silently miss unlisted deployment names |
feat(proxy): resolve Cursor thinking/fast model-name suffixes on /cursor/chat/completions
| variant = _parse_cursor_model_variant(model) | ||
| if variant.base_model == model or not _router_can_serve(variant.base_model, llm_router): | ||
| return data | ||
| resolved = {**data, "model": variant.base_model} # mutable-ok: plain body dict |
There was a problem hiding this comment.
High: Per-model budget bypass
user_api_key_auth checks key and end-user model_max_budget against the original request model before this handler runs. An authenticated user can request a name such as claude-opus-5-thinking-high; the budget lookup treats that unconfigured alias as unrestricted, and this code then executes claude-opus-5 even when its model budget is exhausted. Canonicalize the model before the authentication dependency runs, or repeat all model-access and per-model budget checks against variant.base_model before dispatch.
There was a problem hiding this comment.
Per-model budget bypass
Already fixed in #35834, which resolves the variant before auth so budget checks see the base model. Leaving open to re-verify later
PR overviewThis pull request updates the Two security issues remain open. An authenticated user can bypass per-model budget enforcement by requesting an alias that is normalized only after authorization checks, allowing use of a base model whose budget is exhausted. Streamed tool-call assembly can also consume excessive worker CPU for long outputs due to quadratic concatenation behavior; no issues have yet been addressed. Open issues (2)
Fixed/addressed: 0 · PR risk: 6/10 |
| tool_call_map[index]["name"] = function["name"] | ||
| if function.get("arguments"): | ||
| tool_call_map[index]["arguments"].append(function["arguments"]) | ||
| tool_call_map[index]["arguments"] += (function["arguments"],) |
There was a problem hiding this comment.
Low: Quadratic tool-call stream assembly
Each tuple concatenation copies all previously collected chunks, so assembling a tool call with many streamed argument deltas takes quadratic time and blocks the worker during end-of-stream processing. An authenticated caller can repeatedly request long tool-call outputs to consume proxy CPU; keep arguments and custom_input as lists, append each delta, and join once after collection.
There was a problem hiding this comment.
Quadratic tool-call stream assembly
Already fixed in #35826, which groups fragments once so assembly is linear. Leaving open to re-verify later
…7.0) (#336) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | minor | `v1.96.2` → `v1.97.0` | --- ### Release Notes <details> <summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary> ### [`v1.97.0`](https://github.com/BerriAI/litellm/releases/tag/v1.97.0) [Compare Source](https://github.com/BerriAI/litellm/compare/v1.97.0...v1.97.0) ##### Verify Docker Image Signature All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](https://github.com/BerriAI/litellm/commit/0112e53046018d726492c814b3644b7d376029d0). **Verify using the pinned commit hash (recommended):** A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key: ```bash cosign verify \ --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \ ghcr.io/berriai/litellm:v1.97.0 ``` **Verify using the release tag (convenience):** Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules: ```bash cosign verify \ --key https://raw.githubusercontent.com/BerriAI/litellm/v1.97.0/cosign.pub \ ghcr.io/berriai/litellm:v1.97.0 ``` Expected output: ``` The following checks were performed on each of these signatures: - The cosign claims were validated - The signatures were verified against the specified public key ``` *** ##### What's Changed - feat(proxy): resolve Cursor thinking/fast model-name suffixes on /cursor/chat/completions by [@​mateo-berri](https://github.com/mateo-berri) in [#​35554](https://github.com/BerriAI/litellm/pull/35554) - fix(team-callbacks): actually stop logging when disable\_logging is called by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35520](https://github.com/BerriAI/litellm/pull/35520) - refactor(lint): drop redundant !s f-string conversion flags and fix displaced import-group comments by [@​mateo-berri](https://github.com/mateo-berri) in [#​35546](https://github.com/BerriAI/litellm/pull/35546) - fix(proxy): backfill null user\_email on existing users during JWT auth by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34588](https://github.com/BerriAI/litellm/pull/34588) - feat(playground): add non-streaming response toggle by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35560](https://github.com/BerriAI/litellm/pull/35560) - feat(teams): apply default organization to new teams from default team settings by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35540](https://github.com/BerriAI/litellm/pull/35540) - fix(ui): block Playground page for viewer roles on direct URL access by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35676](https://github.com/BerriAI/litellm/pull/35676) - fix(caching): close evicted LLM clients so their connections are reclaimed by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35492](https://github.com/BerriAI/litellm/pull/35492) - chore(deps): update brace-expansion, postcss, and gitpython to current patch releases by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35692](https://github.com/BerriAI/litellm/pull/35692) - refactor(ui): rename the create MCP server component to PascalCase by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35686](https://github.com/BerriAI/litellm/pull/35686) - fix(openai): drop undefined Union from owns\_wrapped\_http\_client annotation by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35706](https://github.com/BerriAI/litellm/pull/35706) - fix(openai): drop the undefined Union from owns\_wrapped\_http\_client by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35704](https://github.com/BerriAI/litellm/pull/35704) - chore(ui): note Google's Agent Platform rename in vector store setup by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​28076](https://github.com/BerriAI/litellm/pull/28076) - fix(proxy): apply key/team router\_settings.model\_group\_alias by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35486](https://github.com/BerriAI/litellm/pull/35486) - feat(complexity\_router): default session affinity off and expose it in the UI by [@​tin-berri](https://github.com/tin-berri) in [#​35714](https://github.com/BerriAI/litellm/pull/35714) - fix(datadog): read team callback dd\_\* params from kwargs instead of blocked dynamic params ([#​35115](https://github.com/BerriAI/litellm/issues/35115) port) by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35687](https://github.com/BerriAI/litellm/pull/35687) - refactor(ui): extract the MCP create form's logic and field groups by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35694](https://github.com/BerriAI/litellm/pull/35694) - test(ui): tier the MCP create tests into unit and integration by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35697](https://github.com/BerriAI/litellm/pull/35697) - fix(proxy): redact credential headers from request logging copies by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35678](https://github.com/BerriAI/litellm/pull/35678) - feat(guardrails/rubrik): prompt moderation, response-text blocking, streaming buffer, failure logging by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35722](https://github.com/BerriAI/litellm/pull/35722) - fix(ui): render Responses API request and response in the logs drawer by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35718](https://github.com/BerriAI/litellm/pull/35718) - fix(ui): hide guardrail review buttons from non-admin users by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​27535](https://github.com/BerriAI/litellm/pull/27535) - feat(team): custom metadata validation hook for team create and update by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​33353](https://github.com/BerriAI/litellm/pull/33353) - ci(circleci): install a pinned Rust toolchain on the Linux jobs by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35519](https://github.com/BerriAI/litellm/pull/35519) - fix(bedrock): stop forwarding no-op toolSpec.strict to Converse by [@​tin-berri](https://github.com/tin-berri) in [#​35688](https://github.com/BerriAI/litellm/pull/35688) - fix(ui): reject an auto-router keyword rule left empty instead of dropping it by [@​tin-berri](https://github.com/tin-berri) in [#​35705](https://github.com/BerriAI/litellm/pull/35705) - fix(guardrails/rubrik): attribute blocked requests to the caller that made them by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35734](https://github.com/BerriAI/litellm/pull/35734) - fix(responses): forward client headers to the provider on /v1/responses by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34531](https://github.com/BerriAI/litellm/pull/34531) - feat(spend): add net auto-router savings to the cost-optimization dashboard by [@​tin-berri](https://github.com/tin-berri) in [#​35521](https://github.com/BerriAI/litellm/pull/35521) - chore(typing): clear basedpyright Any errors in budget reset, access groups, and cache settings by [@​mateo-berri](https://github.com/mateo-berri) in [#​35719](https://github.com/BerriAI/litellm/pull/35719) - fix(spend): read what a request cost from the record instead of pricing it again by [@​tin-berri](https://github.com/tin-berri) in [#​35736](https://github.com/BerriAI/litellm/pull/35736) - perf: install hiredis so redis-py parses replies with its C parser by [@​Classic298](https://github.com/Classic298) in [#​35709](https://github.com/BerriAI/litellm/pull/35709) - feat(ui): show auto-router savings on the cost-optimization dashboard by [@​tin-berri](https://github.com/tin-berri) in [#​35522](https://github.com/BerriAI/litellm/pull/35522) - perf: build log messages lazily so filtered-out log records cost nothing by [@​Classic298](https://github.com/Classic298) in [#​35703](https://github.com/BerriAI/litellm/pull/35703) - fix(proxy): retry model cost map fetch with Retry-After-aware backoff and keep current map on reload failure by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35739](https://github.com/BerriAI/litellm/pull/35739) - feat(otel): stamp service tier attributes on inference spans by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35679](https://github.com/BerriAI/litellm/pull/35679) - fix(proxy): log the model cost map reload failure lazily by [@​tin-berri](https://github.com/tin-berri) in [#​35750](https://github.com/BerriAI/litellm/pull/35750) - fix(groq): translate web\_search\_options to the browser\_search tool by [@​hMED22](https://github.com/hMED22) in [#​34971](https://github.com/BerriAI/litellm/pull/34971) - feat(ui): add admin-configurable user banner by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35729](https://github.com/BerriAI/litellm/pull/35729) - fix(e2e): make spend-counter redis connection env-driven for non-cluster deployments by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35732](https://github.com/BerriAI/litellm/pull/35732) - fix(proxy): make /cursor/chat/completions work with Cursor agent mode by [@​tin-berri](https://github.com/tin-berri) in [#​34029](https://github.com/BerriAI/litellm/pull/34029) - fix(proxy): propagate user\_email and bind api\_key on JWT auth attribution paths by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34331](https://github.com/BerriAI/litellm/pull/34331) - chore(build): move the Admin UI toolchain to Node 24 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35801](https://github.com/BerriAI/litellm/pull/35801) - test(e2e): vendor API strategy coverage across endpoints by [@​mubashir1osmani](https://github.com/mubashir1osmani) in [#​34649](https://github.com/BerriAI/litellm/pull/34649) - chore(deps): upgrade cryptography to 50.0.0 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35803](https://github.com/BerriAI/litellm/pull/35803) - test(e2e): cover legacy text /completions endpoint by [@​mubashir1osmani](https://github.com/mubashir1osmani) in [#​34431](https://github.com/BerriAI/litellm/pull/34431) - feat(gemini): add gemini-robotics-er-2-preview and gemini-robotics-er-1.6-preview by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35555](https://github.com/BerriAI/litellm/pull/35555) - test(e2e): move load/perf testing out of the main suite and drop the vllm passthrough test by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35820](https://github.com/BerriAI/litellm/pull/35820) - feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) by [@​mateo-berri](https://github.com/mateo-berri) in [#​35807](https://github.com/BerriAI/litellm/pull/35807) - chore: bump litellm-proxy-extras 0.4.81 -> 0.4.82, litellm 1.96.0 -> 1.97.0 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35810](https://github.com/BerriAI/litellm/pull/35810) - fix(bedrock): drop conflicting tool\_choice.type when toolConfig.toolChoice is set by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35738](https://github.com/BerriAI/litellm/pull/35738) - docs(CLAUDE.md): prefer commas over semicolons when replacing em dashes by [@​mateo-berri](https://github.com/mateo-berri) in [#​35825](https://github.com/BerriAI/litellm/pull/35825) - chore(lint): zero out basedpyright headroom for purely local rules by [@​mateo-berri](https://github.com/mateo-berri) in [#​35828](https://github.com/BerriAI/litellm/pull/35828) - test(e2e): retry provider-transient statuses at the transport with bounded backoff by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35824](https://github.com/BerriAI/litellm/pull/35824) - chore(ci): promote internal staging to main by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35836](https://github.com/BerriAI/litellm/pull/35836) - refactor(ui): route MCP session tokens through the shared storage helper by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35835](https://github.com/BerriAI/litellm/pull/35835) - docs(helm): replace the classic chart's 128Mi resource example with the documented 4Gi sizing by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35830](https://github.com/BerriAI/litellm/pull/35830) - fix(proxy): persist periodic reload schedule state so status survives restarts and fires without store\_model\_in\_db by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35165](https://github.com/BerriAI/litellm/pull/35165) - fix(router): eagerly fetch Vertex AI deferred stream to surface HTTP errors in \_acompletion fallback path by [@​deepanshululla](https://github.com/deepanshululla) in [#​34627](https://github.com/BerriAI/litellm/pull/34627) - fix(azure\_storage): honor AZURE\_STORAGE\_ENDPOINT\_SUFFIX for sovereign clouds by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35806](https://github.com/BerriAI/litellm/pull/35806) - fix(proxy): apply key\_alias/key\_hash filters to all /key/list visibility branches by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35840](https://github.com/BerriAI/litellm/pull/35840) - fix(proxy): enforce per-model budgets against resolved cursor model variants by [@​mateo-berri](https://github.com/mateo-berri) in [#​35834](https://github.com/BerriAI/litellm/pull/35834) - feat(ui): reorder Add Auto Router into name + template, with a collapsible detailed config by [@​tin-berri](https://github.com/tin-berri) in [#​35746](https://github.com/BerriAI/litellm/pull/35746) - test: repair three failing suites on litellm\_internal\_staging by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35845](https://github.com/BerriAI/litellm/pull/35845) - fix(guardrails): scan model output on the /openai/v1/responses alias by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35818](https://github.com/BerriAI/litellm/pull/35818) - ci: pin Node on the Playwright UI lanes so npm ci meets the engines floor by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35848](https://github.com/BerriAI/litellm/pull/35848) - fix(pricing): apply OpenAI's gpt-5.6 terra/luna cut to Azure cost map by [@​mubashir1osmani](https://github.com/mubashir1osmani) in [#​35481](https://github.com/BerriAI/litellm/pull/35481) - feat(spend): add caller-scoped key/user/team/organization spend report endpoints by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35725](https://github.com/BerriAI/litellm/pull/35725) - revert: "fix(caching): close evicted LLM clients so their connections are reclaimed ([#​35492](https://github.com/BerriAI/litellm/issues/35492))" by [@​mateo-berri](https://github.com/mateo-berri) in [#​35856](https://github.com/BerriAI/litellm/pull/35856) - refactor(repositories): add prisma protocol seams and a spend-reset unit of work by [@​mateo-berri](https://github.com/mateo-berri) in [#​35748](https://github.com/BerriAI/litellm/pull/35748) - perf(streaming): assemble streamed tool-call arguments in linear time by [@​mateo-berri](https://github.com/mateo-berri) in [#​35826](https://github.com/BerriAI/litellm/pull/35826) - fix(s3\_v2): sign S3 object URLs with S3SigV4Auth so encoded paths verify by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35726](https://github.com/BerriAI/litellm/pull/35726) - test(e2e): self-seed the ui suite's password-login users in global setup by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35863](https://github.com/BerriAI/litellm/pull/35863) - fix(claude-code): create-only skill registration with a PUT update route (LIT-4110) by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​31752](https://github.com/BerriAI/litellm/pull/31752) - fix(proxy): fix zguard httpcode when block input by [@​jwang-gif](https://github.com/jwang-gif) in [#​31948](https://github.com/BerriAI/litellm/pull/31948) - fix(lint): pick the merge-aware base so in-progress merges are not blamed for base drift by [@​mateo-berri](https://github.com/mateo-berri) in [#​35868](https://github.com/BerriAI/litellm/pull/35868) - chore: bump litellm-proxy-extras 0.4.82 -> 0.4.83 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35877](https://github.com/BerriAI/litellm/pull/35877) - feat(ui): add Test Routing to the auto router create form by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35859](https://github.com/BerriAI/litellm/pull/35859) - fix(ui): derive auto-router preset tests from the bundled preset JSON by [@​tin-berri](https://github.com/tin-berri) in [#​35882](https://github.com/BerriAI/litellm/pull/35882) - revert: "test(e2e): vendor API strategy coverage across endpoints" ([#​34649](https://github.com/BerriAI/litellm/issues/34649)) by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35881](https://github.com/BerriAI/litellm/pull/35881) - chore(deps): bump grpc and golang.org/x modules in the terraform provider by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35844](https://github.com/BerriAI/litellm/pull/35844) - test(e2e): skip view-backed global spend probes pending LIT-5211 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35875](https://github.com/BerriAI/litellm/pull/35875) - fix(lint): move the basedpyright heap flag into the type check gate by [@​mateo-berri](https://github.com/mateo-berri) in [#​35869](https://github.com/BerriAI/litellm/pull/35869) - chore(ci): promote internal staging to main by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35876](https://github.com/BerriAI/litellm/pull/35876) - feat(ui): add role capability gating, migrate Tool Policies route by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35812](https://github.com/BerriAI/litellm/pull/35812) - refactor(ui): inject the fetch client's base url instead of reading it at import by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35802](https://github.com/BerriAI/litellm/pull/35802) - chore: remove unused .flake8 config and flake8 dev dependency by [@​mateo-berri](https://github.com/mateo-berri) in [#​35888](https://github.com/BerriAI/litellm/pull/35888) - chore: stop advising pre-commit and bootstrap by [@​mateo-berri](https://github.com/mateo-berri) in [#​35884](https://github.com/BerriAI/litellm/pull/35884) - fix(auth): name enable\_jwt\_auth when a JWT-shaped key is rejected by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35831](https://github.com/BerriAI/litellm/pull/35831) - feat(auto-router): make reminder marker pair configurable by [@​akapur99](https://github.com/akapur99) in [#​35874](https://github.com/BerriAI/litellm/pull/35874) - fix(UI): update anthropic model presets by [@​tin-berri](https://github.com/tin-berri) in [#​35896](https://github.com/BerriAI/litellm/pull/35896) - fix(bootstrap): switch to the dashboard node floor via nvm or fnm by [@​mateo-berri](https://github.com/mateo-berri) in [#​35895](https://github.com/BerriAI/litellm/pull/35895) - perf(pre-commit): run python, dashboard, and gen-api checks concurrently by [@​mateo-berri](https://github.com/mateo-berri) in [#​35903](https://github.com/BerriAI/litellm/pull/35903) - feat(spend): derive a default auto-router savings baseline from the hardest tier by [@​tin-berri](https://github.com/tin-berri) in [#​35907](https://github.com/BerriAI/litellm/pull/35907) - fix(http\_handler): self-heal handler clients closed after cache eviction by [@​mateo-berri](https://github.com/mateo-berri) in [#​35862](https://github.com/BerriAI/litellm/pull/35862) - fix(cost\_tracking): keep OpenAI prompt cache token details through usage reassembly by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34812](https://github.com/BerriAI/litellm/pull/34812) - fix(cost): bill gpt-5.6 prompt cache reads at the cache read rate by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34957](https://github.com/BerriAI/litellm/pull/34957) - fix(batches): account for Responses API usage by [@​rimysore](https://github.com/rimysore) in [#​35367](https://github.com/BerriAI/litellm/pull/35367) - ci: retry Codecov uploads and stop failing jobs on OIDC token flakes by [@​mateo-berri](https://github.com/mateo-berri) in [#​35251](https://github.com/BerriAI/litellm/pull/35251) - feat(complexity\_router): let operators rename the four complexity tiers by [@​akapur99](https://github.com/akapur99) in [#​35893](https://github.com/BerriAI/litellm/pull/35893) - chore(lint): zero stale ruff and LIT headroom and strip inert type: ignore comments by [@​mateo-berri](https://github.com/mateo-berri) in [#​35928](https://github.com/BerriAI/litellm/pull/35928) - chore(lint): zero out seven more purely local basedpyright rules by [@​mateo-berri](https://github.com/mateo-berri) in [#​35927](https://github.com/BerriAI/litellm/pull/35927) - chore(ui): zero stale headroom on local dashboard eslint budgets by [@​mateo-berri](https://github.com/mateo-berri) in [#​35929](https://github.com/BerriAI/litellm/pull/35929) - fix(managed-files): skip rows without file objects by [@​rimysore](https://github.com/rimysore) in [#​35365](https://github.com/BerriAI/litellm/pull/35365) - fix(router): redact fallback tracebacks at the call site and cover the sync deferred stream by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35843](https://github.com/BerriAI/litellm/pull/35843) - fix(migrations): recover from an interrupted Prisma toolchain install by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35832](https://github.com/BerriAI/litellm/pull/35832) - fix(lint): bring basedpyright rule counts back under their budget limits by [@​mateo-berri](https://github.com/mateo-berri) in [#​35962](https://github.com/BerriAI/litellm/pull/35962) - chore(ui): don't zero out stale headroom except no-console by [@​mateo-berri](https://github.com/mateo-berri) in [#​35964](https://github.com/BerriAI/litellm/pull/35964) - fix(proxy): give proxy\_admin\_viewer read parity with proxy\_admin by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35851](https://github.com/BerriAI/litellm/pull/35851) - refactor(ui): address UI lint budget issues by refactoring UI by [@​tin-berri](https://github.com/tin-berri) in [#​35960](https://github.com/BerriAI/litellm/pull/35960) - fix(ci): make the env-key doc gate see get\_secret\_bool reads by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35833](https://github.com/BerriAI/litellm/pull/35833) - fix(caching): re-land evicted LLM client closing ([#​35492](https://github.com/BerriAI/litellm/issues/35492)) atop self-healing handlers by [@​mateo-berri](https://github.com/mateo-berri) in [#​35870](https://github.com/BerriAI/litellm/pull/35870) - fix(proxy): keep the connected DB client when a startup health check fails by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35837](https://github.com/BerriAI/litellm/pull/35837) - chore(lint): remove litellm/types from the ruff lint exclusion by [@​mateo-berri](https://github.com/mateo-berri) in [#​35926](https://github.com/BerriAI/litellm/pull/35926) - feat(sgr): make the gateway middleware the source of truth for successful requests by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35717](https://github.com/BerriAI/litellm/pull/35717) - feat(auto-router): let operators replace the LLM classifier's system prompt by [@​akapur99](https://github.com/akapur99) in [#​35855](https://github.com/BerriAI/litellm/pull/35855) - fix(docker): bake the pip image's prisma engines at a world-readable path by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35976](https://github.com/BerriAI/litellm/pull/35976) - fix(auth): return 403 from the OAuth2 enterprise gate by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35838](https://github.com/BerriAI/litellm/pull/35838) - fix(router): keep custom model\_info across a price data reload by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35491](https://github.com/BerriAI/litellm/pull/35491) - fix(proxy): resolve pass-through credentials live from router deployments by [@​mateo-berri](https://github.com/mateo-berri) in [#​35916](https://github.com/BerriAI/litellm/pull/35916) - fix(ci): fetch only head and merge-base in lint jobs instead of every branch by [@​mateo-berri](https://github.com/mateo-berri) in [#​35982](https://github.com/BerriAI/litellm/pull/35982) - fix(autorouter): match CJK keyword\_tier\_rules that regex word boundaries miss by [@​akapur99](https://github.com/akapur99) in [#​35984](https://github.com/BerriAI/litellm/pull/35984) - feat(spend): rebuild the auto-router benchmarks backend as a per-session rollup by [@​tin-berri](https://github.com/tin-berri) in [#​35910](https://github.com/BerriAI/litellm/pull/35910) - refactor(ui): replace hand-rolled query-param routing with nuqs by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35871](https://github.com/BerriAI/litellm/pull/35871) - fix(docker): bake the componentized prisma engines at /opt/prisma so any uid can start by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35989](https://github.com/BerriAI/litellm/pull/35989) - fix(migrations): keep the toolchain heal from raising on an unreadable nodeenv cache by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35986](https://github.com/BerriAI/litellm/pull/35986) - fix(bedrock): sign Bedrock managed-file S3 requests with S3SigV4Auth by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35983](https://github.com/BerriAI/litellm/pull/35983) - chore(typing): replace Any seams with real types across responses, proxy, and provider adapters by [@​mateo-berri](https://github.com/mateo-berri) in [#​35809](https://github.com/BerriAI/litellm/pull/35809) - fix(ai21): resolve the documented AI21\_API\_KEY instead of a misspelled name by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35985](https://github.com/BerriAI/litellm/pull/35985) - fix(docker): fail the image build when the generated prisma engine paths drift off /opt/prisma by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35979](https://github.com/BerriAI/litellm/pull/35979) - fix(jina\_ai): resolve the documented JINA\_API\_KEY as a fallback by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35992](https://github.com/BerriAI/litellm/pull/35992) - fix(proxy): only treat a recoverable database outage as grounds to serve without one by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35864](https://github.com/BerriAI/litellm/pull/35864) - fix(ci): make every remaining CI checkout shallow by [@​mateo-berri](https://github.com/mateo-berri) in [#​35997](https://github.com/BerriAI/litellm/pull/35997) - fix(auto-router): stop the embedding model's context window from failing long requests by [@​akapur99](https://github.com/akapur99) in [#​35956](https://github.com/BerriAI/litellm/pull/35956) - fix(ci): make the env-key doc gate see bare get\_secret and get\_secret\_str reads by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35996](https://github.com/BerriAI/litellm/pull/35996) - fix(logging): extend secret redaction to records litellm does not emit directly by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35977](https://github.com/BerriAI/litellm/pull/35977) - test(utils): pin the register\_model replay test to the recorded half by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35994](https://github.com/BerriAI/litellm/pull/35994) - fix(ci): run every helm test suite, not just the first one per file by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35993](https://github.com/BerriAI/litellm/pull/35993) - ci: fail the build when a test file or Dockerfile is invoked by no job by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35991](https://github.com/BerriAI/litellm/pull/35991) - fix(langfuse): stop a collected httpx handler from closing a shared client by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35981](https://github.com/BerriAI/litellm/pull/35981) - fix(bedrock): grant bedrock:CountTokens in OIDC session policy by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​33145](https://github.com/BerriAI/litellm/pull/33145) - feat(pre-commit): save full lint output to a per-worktree log file by [@​mateo-berri](https://github.com/mateo-berri) in [#​36004](https://github.com/BerriAI/litellm/pull/36004) - feat(ui): match auto-router preset models against deployments' underlying model IDs by [@​tin-berri](https://github.com/tin-berri) in [#​35972](https://github.com/BerriAI/litellm/pull/35972) - fix(core\_helpers): map generic 'error' finish\_reason to 'stop' by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​33972](https://github.com/BerriAI/litellm/pull/33972) - fix(proxy)!: apply request-parameter checks consistently across body, path and form inputs by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36011](https://github.com/BerriAI/litellm/pull/36011) - fix: rebuild models\_by\_provider in add\_known\_models so cost map reloads reach wildcard expansion by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36010](https://github.com/BerriAI/litellm/pull/36010) - feat(complexity\_router): report LLM classifier cost per request via routing\_decision and x-litellm-classifier-cost header by [@​tin-berri](https://github.com/tin-berri) in [#​36015](https://github.com/BerriAI/litellm/pull/36015) - fix(model-prices): correct replicate model key typo by [@​AkashNaickar](https://github.com/AkashNaickar) in [#​34800](https://github.com/BerriAI/litellm/pull/34800) - fix(proxy): register managed batch output files on terminal retrieve by [@​Souravrajvi0](https://github.com/Souravrajvi0) in [#​34092](https://github.com/BerriAI/litellm/pull/34092) - perf(pre-commit): fetch basedpyright base counts from CI artifacts by [@​mateo-berri](https://github.com/mateo-berri) in [#​35970](https://github.com/BerriAI/litellm/pull/35970) - fix(ui): sync projects list page index to ?page= so back and reload keep the page by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36003](https://github.com/BerriAI/litellm/pull/36003) - fix(ui): link project page keys to their virtual key detail by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36002](https://github.com/BerriAI/litellm/pull/36002) - refactor(ui): drop unreferenced locals from dashboard route components by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35819](https://github.com/BerriAI/litellm/pull/35819) - fix(ui): opening a project now pushes ?project= so back and deep links work by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36001](https://github.com/BerriAI/litellm/pull/36001) - refactor(ui): drop unreferenced locals from shared dashboard components by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35821](https://github.com/BerriAI/litellm/pull/35821) - refactor(ui): drop unreferenced locals from tests and narrow destructures by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36025](https://github.com/BerriAI/litellm/pull/36025) - fix(guardrails): allow litellm\_content\_filter to run on post\_mcp\_call by [@​mateo-berri](https://github.com/mateo-berri) in [#​35980](https://github.com/BerriAI/litellm/pull/35980) - fix(guardrails): scan /v1/messages tool traffic by [@​mateo-berri](https://github.com/mateo-berri) in [#​35999](https://github.com/BerriAI/litellm/pull/35999) - refactor(ui): drop dead locals and unused React state across the dashboard by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36026](https://github.com/BerriAI/litellm/pull/36026) - feat(ui): add the auto-router usage tab to cost optimization by [@​tin-berri](https://github.com/tin-berri) in [#​35995](https://github.com/BerriAI/litellm/pull/35995) - fix(managed\_files): derive unified output file ids deterministically so concurrent registrations converge by [@​mateo-berri](https://github.com/mateo-berri) in [#​36019](https://github.com/BerriAI/litellm/pull/36019) - fix(proxy): send keepalive pings on anthropic messages SSE streams during upstream silence by [@​mateo-berri](https://github.com/mateo-berri) in [#​36024](https://github.com/BerriAI/litellm/pull/36024) - fix(managed\_files): return unified ids from unscoped file listing by [@​mateo-berri](https://github.com/mateo-berri) in [#​36031](https://github.com/BerriAI/litellm/pull/36031) - fix(arize\_phoenix): lowercase OTLP/gRPC auth metadata key by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34883](https://github.com/BerriAI/litellm/pull/34883) - fix(auto-router): accept every reminder marker pair a harness emits by [@​tin-berri](https://github.com/tin-berri) in [#​36029](https://github.com/BerriAI/litellm/pull/36029) - fix(pricing): sync flex/priority tier keys to dated OpenAI snapshot variants by [@​mateo-berri](https://github.com/mateo-berri) in [#​35923](https://github.com/BerriAI/litellm/pull/35923) - fix(cost): bill reasoning tokens at the service tier output rate by [@​mateo-berri](https://github.com/mateo-berri) in [#​35925](https://github.com/BerriAI/litellm/pull/35925) - fix(proxy): include today's UTC bucket when a daily activity range ends at the caller's current day by [@​tin-berri](https://github.com/tin-berri) in [#​36051](https://github.com/BerriAI/litellm/pull/36051) - fix: expired-miss share over all measured turns + cost-optimization tab labels by [@​tin-berri](https://github.com/tin-berri) in [#​36037](https://github.com/BerriAI/litellm/pull/36037) - fix(router): include Bedrock batch/S3 fields and model in deployment credentials by [@​mpcusack-altos](https://github.com/mpcusack-altos) in [#​24548](https://github.com/BerriAI/litellm/pull/24548) - fix(batch): track cost for managed batches with no attributable key/u… by [@​elinacse](https://github.com/elinacse) in [#​35468](https://github.com/BerriAI/litellm/pull/35468) - feat(guardrails): add scan\_only\_tool\_results to scope unified guardrails to tool results by [@​mateo-berri](https://github.com/mateo-berri) in [#​36014](https://github.com/BerriAI/litellm/pull/36014) - fix(cost): stop token-pricing the placeholder input on file content calls by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35140](https://github.com/BerriAI/litellm/pull/35140) - fix(proxy): fetch background responses through the router in CheckResponsesCost by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35137](https://github.com/BerriAI/litellm/pull/35137) - fix(proxy): yaml store\_prompts\_in\_spend\_logs should take precedence over DB cached value by [@​Praveena-617](https://github.com/Praveena-617) in [#​35769](https://github.com/BerriAI/litellm/pull/35769) - fix(lint): measure the basedpyright budget gate in a gate-owned venv by [@​mateo-berri](https://github.com/mateo-berri) in [#​36050](https://github.com/BerriAI/litellm/pull/36050) - docs: cap all GitHub comments at 15-25 words, curb semicolon splices by [@​mateo-berri](https://github.com/mateo-berri) in [#​36059](https://github.com/BerriAI/litellm/pull/36059) - chore(lint): name MappingProxyType in the mutable-collection fix messages by [@​mateo-berri](https://github.com/mateo-berri) in [#​36072](https://github.com/BerriAI/litellm/pull/36072) - test: roll back runtime model registrations between tests by [@​mateo-berri](https://github.com/mateo-berri) in [#​36039](https://github.com/BerriAI/litellm/pull/36039) - refactor(types): cut 653 implicit and explicit Any diagnostics across 11 modules by [@​mateo-berri](https://github.com/mateo-berri) in [#​36054](https://github.com/BerriAI/litellm/pull/36054) - fix(proxy): stop resolving the UI session sentinel team on /search\_tools/list by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36061](https://github.com/BerriAI/litellm/pull/36061) - fix(batches): persist managed file ids for cancelled/failed/expired batches by [@​mateo-berri](https://github.com/mateo-berri) in [#​36048](https://github.com/BerriAI/litellm/pull/36048) - fix(batches): register managed output files on batch cancel by [@​mateo-berri](https://github.com/mateo-berri) in [#​36034](https://github.com/BerriAI/litellm/pull/36034) - fix(proxy): allow non-admins to reach /user/daily/activity/aggregated by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36062](https://github.com/BerriAI/litellm/pull/36062) - fix(anthropic): coerce explicit additionalProperties to false in output\_format schema by [@​dkindlund](https://github.com/dkindlund) in [#​35811](https://github.com/BerriAI/litellm/pull/35811) - fix(batches): prevent managed file fallbacks by [@​rimysore](https://github.com/rimysore) in [#​35371](https://github.com/BerriAI/litellm/pull/35371) - chore: ignore the mechanical lint and typing sweeps in git blame by [@​mateo-berri](https://github.com/mateo-berri) in [#​36076](https://github.com/BerriAI/litellm/pull/36076) - fix(proxy): warn at startup when max\_budget is set but no database is connected by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36041](https://github.com/BerriAI/litellm/pull/36041) - fix(proxy): promote caller metadata trace fields into litellm\_metadata by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35866](https://github.com/BerriAI/litellm/pull/35866) - feat(terraform): sync provider 0.3.0 from the mirror and cut 0.4.0 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36098](https://github.com/BerriAI/litellm/pull/36098) - fix(guardrails): honor configured timeout in Zscaler AI Guard by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​36110](https://github.com/BerriAI/litellm/pull/36110) - fix(logging): fall back to litellm\_metadata when metadata is empty by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​36105](https://github.com/BerriAI/litellm/pull/36105) - fix(proxy): re-assert the authenticated identity on passthrough requests by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​36121](https://github.com/BerriAI/litellm/pull/36121) - chore: bump litellm-enterprise 0.1.53 -> 0.1.54, litellm-proxy-extras 0.4.83 -> 0.4.84 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36139](https://github.com/BerriAI/litellm/pull/36139) - fix(ui): match auto-router preset models against wildcard-expanded model groups by [@​tin-berri](https://github.com/tin-berri) in [#​36111](https://github.com/BerriAI/litellm/pull/36111) - test(router): assert the auto-router max\_input\_chars kwarg by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36109](https://github.com/BerriAI/litellm/pull/36109) - fix(ui): allow clearing a key's budget reset from the Edit Key form by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36140](https://github.com/BerriAI/litellm/pull/36140) - fix(managed\_files): skip unparseable rows when listing managed files by [@​mateo-berri](https://github.com/mateo-berri) in [#​36021](https://github.com/BerriAI/litellm/pull/36021) - fix(a2a): stop writing per-caller headers onto the shared cached httpx client by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35978](https://github.com/BerriAI/litellm/pull/35978) - build(deps): bump h2 to 4.4.1 and js-yaml to 4.3.1 by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36147](https://github.com/BerriAI/litellm/pull/36147) - chore: promote staging to main by [@​mateo-berri](https://github.com/mateo-berri) in [#​36057](https://github.com/BerriAI/litellm/pull/36057) - fix(azure\_sentinel): respect AZURE\_AUTHORITY\_HOST and derive the Azure Monitor audience per cloud by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​36137](https://github.com/BerriAI/litellm/pull/36137) - fix(bedrock): pass SSE-KMS key through to the batch input-file S3 upload by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35148](https://github.com/BerriAI/litellm/pull/35148) - fix(anthropic adapter): stop indexing choices\[0] on choiceless streaming chunks by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35314](https://github.com/BerriAI/litellm/pull/35314) - fix(bedrock): normalize /v1/completions and /v1/responses batch records by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35675](https://github.com/BerriAI/litellm/pull/35675) - fix(proxy): return the real status code when a credential update is rejected by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​36166](https://github.com/BerriAI/litellm/pull/36166) - fix(proxy): improve Headroom /v1/compress HTTP 404 diagnostics by [@​aayush598](https://github.com/aayush598) in [#​35952](https://github.com/BerriAI/litellm/pull/35952) - fix(proxy): invalidate cached project object on project update and delete by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36028](https://github.com/BerriAI/litellm/pull/36028) - feat(proxy): add apply\_user\_budget\_to\_team\_keys opt-in by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36102](https://github.com/BerriAI/litellm/pull/36102) - fix(proxy): stop alerting on health probes that lose the planned engine-restart race by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​36141](https://github.com/BerriAI/litellm/pull/36141) - test(docker): gate the componentized gateway and backend images on an arbitrary-uid offline boot by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​36136](https://github.com/BerriAI/litellm/pull/36136) - fix(http): stop pooled clients persisting cookies on the aiohttp jar too by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​36149](https://github.com/BerriAI/litellm/pull/36149) - fix(router): bound fallback-walk work and error-log volume by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​36148](https://github.com/BerriAI/litellm/pull/36148) - ci: wire credential\_endpoints tests into the proxy endpoints job by [@​cursor](https://github.com/cursor)\[bot] in [#​36187](https://github.com/BerriAI/litellm/pull/36187) - docs(keys): document /key/info fields and clarify budget\_reset\_at is the next reset by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36127](https://github.com/BerriAI/litellm/pull/36127) - fix(azure\_sentinel): add AZURE\_SENTINEL\_AUTHORITY\_HOST as a Sentinel scoped override by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​36165](https://github.com/BerriAI/litellm/pull/36165) - docs(pr-template): add a User Flow section with authoring instructions by [@​mateo-berri](https://github.com/mateo-berri) in [#​36162](https://github.com/BerriAI/litellm/pull/36162) - fix(proxy): derive config agent ids from agent\_name so grants survive secret rotation by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36020](https://github.com/BerriAI/litellm/pull/36020) - chore(ui): regenerate schema.d.ts for the /key/info docstring update by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36210](https://github.com/BerriAI/litellm/pull/36210) - build(deps): bump gitpython to 3.1.58 to clear osv-scan on staging by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36212](https://github.com/BerriAI/litellm/pull/36212) - fix(proxy): deny agent access when key and team grants resolve to nothing by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36221](https://github.com/BerriAI/litellm/pull/36221) - build(deps): defer the second pypdf advisory until the 6.15.0 bump by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36218](https://github.com/BerriAI/litellm/pull/36218) - fix(a2a): align agent list annotation and test with the tuple return type by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36217](https://github.com/BerriAI/litellm/pull/36217) - ci: always run the UI API types sync check so it can be required by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36213](https://github.com/BerriAI/litellm/pull/36213) - build(deps): bump nanoid to 3.3.17 in the dashboard lockfile by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36227](https://github.com/BerriAI/litellm/pull/36227) - feat(ui): show user email or alias in usage data export by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36232](https://github.com/BerriAI/litellm/pull/36232) - feat(auto-router): track turns per complexity tier (LIT-5302) by [@​tin-berri](https://github.com/tin-berri) in [#​36209](https://github.com/BerriAI/litellm/pull/36209) - fix(websearch): restore snippet text in native web\_search\_tool\_result blocks (LIT-5315) by [@​tin-berri](https://github.com/tin-berri) in [#​36228](https://github.com/BerriAI/litellm/pull/36228) - fix(proxy): resolve entity access groups in the model listing endpoints by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36230](https://github.com/BerriAI/litellm/pull/36230) - fix(ui): let access groups be a team's only model source, with hover provenance by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​36234](https://github.com/BerriAI/litellm/pull/36234) - fix(managed\_files): return unified output file ids from GET /batches by [@​mateo-berri](https://github.com/mateo-berri) in [#​36049](https://github.com/BerriAI/litellm/pull/36049) - test(proxy): compare empty agent list to the tuple get\_agent\_list returns by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36225](https://github.com/BerriAI/litellm/pull/36225) - fix(otel): name the RPC system and upstream on MCP tool-call spans by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35857](https://github.com/BerriAI/litellm/pull/35857) - fix(guardrails): chunk oversized Bedrock ApplyGuardrail requests instead of failing by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​36119](https://github.com/BerriAI/litellm/pull/36119) - test(e2e): settle control-plane writes across every replica, not just one by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36247](https://github.com/BerriAI/litellm/pull/36247) - fix(responses): forward allowed\_openai\_params through the chat completions bridge by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35885](https://github.com/BerriAI/litellm/pull/35885) - test(proxy): assert the copy \_add\_team\_member\_budget\_table returns by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36244](https://github.com/BerriAI/litellm/pull/36244) - chore(ui): regenerate dashboard api types for tier\_turns by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36243](https://github.com/BerriAI/litellm/pull/36243) - refactor(types): declare mirrored pricing fields on ModelInfo by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36215](https://github.com/BerriAI/litellm/pull/36215) - fix(lint): make strict-gate noqas survive base ruff and flag stale ones by [@​mateo-berri](https://github.com/mateo-berri) in [#​36257](https://github.com/BerriAI/litellm/pull/36257) - fix(vertex\_ai): surface real error/status on vertex batch create instead of IndexError 500 by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35141](https://github.com/BerriAI/litellm/pull/35141) - ci: give the remaining pull\_request workflows a concurrency group by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36252](https://github.com/BerriAI/litellm/pull/36252) - refactor(lint): graduate zero-violation strict rules and guard the budget ratchet by [@​mateo-berri](https://github.com/mateo-berri) in [#​36161](https://github.com/BerriAI/litellm/pull/36161) - fix(proxy): enforce require\_managed\_files on every route that accepts a raw provider id by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35551](https://github.com/BerriAI/litellm/pull/35551) - chore(typing): clear 1.4k basedpyright Any errors across 21 hotspot files by [@​mateo-berri](https://github.com/mateo-berri) in [#​36282](https://github.com/BerriAI/litellm/pull/36282) - test: roll back live router replay membership between tests by [@​mateo-berri](https://github.com/mateo-berri) in [#​36278](https://github.com/BerriAI/litellm/pull/36278) - chore(ci): sync main into internal staging by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36288](https://github.com/BerriAI/litellm/pull/36288) - build(lint): rename make pre-commit to make check with a working-tree fallback by [@​mateo-berri](https://github.com/mateo-berri) in [#​36277](https://github.com/BerriAI/litellm/pull/36277) - fix(ui): show team BYOK models in team fallback settings by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36241](https://github.com/BerriAI/litellm/pull/36241) - fix(otel): mark v2 server spans as failed for pre-call errors by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34546](https://github.com/BerriAI/litellm/pull/34546) - fix(websearch\_interception): bill intercepted searches to the calling key by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35708](https://github.com/BerriAI/litellm/pull/35708) - chore: remove pre-commit rule by [@​mateo-berri](https://github.com/mateo-berri) in [#​36295](https://github.com/BerriAI/litellm/pull/36295) - docs: clarify guideline priority ordering in CLAUDE.md by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​36296](https://github.com/BerriAI/litellm/pull/36296) - feat(router): independent, default-on deployment affinity for the auto-router by [@​tin-berri](https://github.com/tin-berri) in [#​36146](https://github.com/BerriAI/litellm/pull/36146) - test: repair stale CircleCI contracts by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36293](https://github.com/BerriAI/litellm/pull/36293) - chore(ci): promote internal staging to main by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36286](https://github.com/BerriAI/litellm/pull/36286) - chore: rebuild Admin UI bundle for the 2026-08-08 release by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36297](https://github.com/BerriAI/litellm/pull/36297) - chore(ci): promote internal staging to main by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​36304](https://github.com/BerriAI/litellm/pull/36304) ##### New Contributors - [@​rimysore](https://github.com/rimysore) made their first contribution in [#​35367](https://github.com/BerriAI/litellm/pull/35367) - [@​AkashNaickar](https://github.com/AkashNaickar) made their first contribution in [#​34800](https://github.com/BerriAI/litellm/pull/34800) - [@​Souravrajvi0](https://github.com/Souravrajvi0) made their first contribution in [#​34092](https://github.com/BerriAI/litellm/pull/34092) - [@​elinacse](https://github.com/elinacse) made their first contribution in [#​35468](https://github.com/BerriAI/litellm/pull/35468) - [@​aayush598](https://github.com/aayush598) made their first contribution in [#​35952](https://github.com/BerriAI/litellm/pull/35952) - [@​cursor](https://github.com/cursor)\[bot] made their first contribution in [#​36187](https://github.com/BerriAI/litellm/pull/36187) **Full Changelog**: <https://github.com/BerriAI/litellm/compare/v1.96.0...v1.97.0> ### [`v1.97.0`](https://github.com/BerriAI/litellm/releases/tag/v1.97.0) [Compare Source](https://github.com/BerriAI/litellm/compare/v1.96.2...v1.97.0) ##### Verify Docker Image Signature All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](https://github.com/BerriAI/litellm/commit/0112e53046018d726492c814b3644b7d376029d0). **Verify using the pinned commit hash (recommended):** A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key: ```bash cosign verify \ --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \ ghcr.io/berriai/litellm:v1.97.0 ``` **Verify using the release tag (convenience):** Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules: ```bash cosign verify \ --key https://raw.githubusercontent.com/BerriAI/litellm/v1.97.0/cosign.pub \ ghcr.io/berriai/litellm:v1.97.0 ``` Expected output: ``` The following checks were performed on each of these signatures: - The cosign claims were validated - The signatures were verified against the specified public key ``` *** ##### What's Changed - feat(proxy): resolve Cursor thinking/fast model-name suffixes on /cursor/chat/completions by [@​mateo-berri](https://github.com/mateo-berri) in [#​35554](https://github.com/BerriAI/litellm/pull/35554) - fix(team-callbacks): actually stop logging when disable\_logging is called by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35520](https://github.com/BerriAI/litellm/pull/35520) - refactor(lint): drop redundant !s f-string conversion flags and fix displaced import-group comments by [@​mateo-berri](https://github.com/mateo-berri) in [#​35546](https://github.com/BerriAI/litellm/pull/35546) - fix(proxy): backfill null user\_email on existing users during JWT auth by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34588](https://github.com/BerriAI/litellm/pull/34588) - feat(playground): add non-streaming response toggle by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35560](https://github.com/BerriAI/litellm/pull/35560) - feat(teams): apply default organization to new teams from default team settings by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35540](https://github.com/BerriAI/litellm/pull/35540) - fix(ui): block Playground page for viewer roles on direct URL access by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35676](https://github.com/BerriAI/litellm/pull/35676) - fix(caching): close evicted LLM clients so their connections are reclaimed by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35492](https://github.com/BerriAI/litellm/pull/35492) - chore(deps): update brace-expansion, postcss, and gitpython to current patch releases by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35692](https://github.com/BerriAI/litellm/pull/35692) - refactor(ui): rename the create MCP server component to PascalCase by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35686](https://github.com/BerriAI/litellm/pull/35686) - fix(openai): drop undefined Union from owns\_wrapped\_http\_client annotation by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35706](https://github.com/BerriAI/litellm/pull/35706) - fix(openai): drop the undefined Union from owns\_wrapped\_http\_client by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35704](https://github.com/BerriAI/litellm/pull/35704) - chore(ui): note Google's Agent Platform rename in vector store setup by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​28076](https://github.com/BerriAI/litellm/pull/28076) - fix(proxy): apply key/team router\_settings.model\_group\_alias by [@​yassin-berriai](https://github.com/yassin-berriai) in [#​35486](https://github.com/BerriAI/litellm/pull/35486) - feat(complexity\_router): default session affinity off and expose it in the UI by [@​tin-berri](https://github.com/tin-berri) in [#​35714](https://github.com/BerriAI/litellm/pull/35714) - fix(datadog): read team callback dd\_\* params from kwargs instead of blocked dynamic params ([#​35115](https://github.com/BerriAI/litellm/issues/35115) port) by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35687](https://github.com/BerriAI/litellm/pull/35687) - refactor(ui): extract the MCP create form's logic and field groups by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35694](https://github.com/BerriAI/litellm/pull/35694) - test(ui): tier the MCP create tests into unit and integration by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35697](https://github.com/BerriAI/litellm/pull/35697) - fix(proxy): redact credential headers from request logging copies by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35678](https://github.com/BerriAI/litellm/pull/35678) - feat(guardrails/rubrik): prompt moderation, response-text blocking, streaming buffer, failure logging by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35722](https://github.com/BerriAI/litellm/pull/35722) - fix(ui): render Responses API request and response in the logs drawer by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35718](https://github.com/BerriAI/litellm/pull/35718) - fix(ui): hide guardrail review buttons from non-admin users by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​27535](https://github.com/BerriAI/litellm/pull/27535) - feat(team): custom metadata validation hook for team create and update by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​33353](https://github.com/BerriAI/litellm/pull/33353) - ci(circleci): install a pinned Rust toolchain on the Linux jobs by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35519](https://github.com/BerriAI/litellm/pull/35519) - fix(bedrock): stop forwarding no-op toolSpec.strict to Converse by [@​tin-berri](https://github.com/tin-berri) in [#​35688](https://github.com/BerriAI/litellm/pull/35688) - fix(ui): reject an auto-router keyword rule left empty instead of dropping it by [@​tin-berri](https://github.com/tin-berri) in [#​35705](https://github.com/BerriAI/litellm/pull/35705) - fix(guardrails/rubrik): attribute blocked requests to the caller that made them by [@​yucheng-berri](https://github.com/yucheng-berri) in [#​35734](https://github.com/BerriAI/litellm/pull/35734) - fix(responses): forward client headers to the provider on /v1/responses by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34531](https://github.com/BerriAI/litellm/pull/34531) - feat(spend): add net auto-router savings to the cost-optimization dashboard by [@​tin-berri](https://github.com/tin-berri) in [#​35521](https://github.com/BerriAI/litellm/pull/35521) - chore(typing): clear basedpyright Any errors in budget reset, access groups, and cache settings by [@​mateo-berri](https://github.com/mateo-berri) in [#​35719](https://github.com/BerriAI/litellm/pull/35719) - fix(spend): read what a request cost from the record instead of pricing it again by [@​tin-berri](https://github.com/tin-berri) in [#​35736](https://github.com/BerriAI/litellm/pull/35736) - perf: install hiredis so redis-py parses replies with its C parser by [@​Classic298](https://github.com/Classic298) in [#​35709](https://github.com/BerriAI/litellm/pull/35709) - feat(ui): show auto-router savings on the cost-optimization dashboard by [@​tin-berri](https://github.com/tin-berri) in [#​35522](https://github.com/BerriAI/litellm/pull/35522) - perf: build log messages lazily so filtered-out log records cost nothing by [@​Classic298](https://github.com/Classic298) in [#​35703](https://github.com/BerriAI/litellm/pull/35703) - fix(proxy): retry model cost map fetch with Retry-After-aware backoff and keep current map on reload failure by [@​ryan-crabbe-berri](https://github.com/ryan-crabbe-berri) in [#​35739](https://github.com/BerriAI/litellm/pull/35739) - feat(otel): stamp service tier attributes on inference spans by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​35679](https://github.com/BerriAI/litellm/pull/35679) - fix(proxy): log the model cost map reload failure lazily by [@​tin-berri](https://github.com/tin-berri) in [#​35750](https://github.com/BerriAI/litellm/pull/35750) - fix(groq): translate web\_search\_options to the browser\_search tool by [@​hMED22](https://github.com/hMED22) in [#​34971](https://github.com/BerriAI/litellm/pull/34971) - feat(ui): add admin-configurable user banner by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35729](https://github.com/BerriAI/litellm/pull/35729) - fix(e2e): make spend-counter redis connection env-driven for non-cluster deployments by [@​yuneng-berri](https://github.com/yuneng-berri) in [#​35732](https://github.com/BerriAI/litellm/pull/35732) - fix(proxy): make /cursor/chat/completions work with Cursor agent mode by [@​tin-berri](https://github.com/tin-berri) in [#​34029](https://github.com/BerriAI/litellm/pull/34029) - fix(proxy): propagate user\_email and bind api\_key on JWT auth attribution paths by [@​devin-ai-integration](https://github.com/devin-ai-integration)\[bot] in [#​34331](https://github.com/BerriAI/litellm/pull/34331) - chore(build): move the Admin UI toolchain to Node 24 by [@​yuneng-berri](https://g…
TLDR
Problem this solves:
How it solves it:
Relevant issues
/cursor/chat/completionsnow handles both request shapes Cursor BYOK sends, so Cursor agent mode works against litellm: Responses-shaped agent-mode bodies (input, flat tool defs, custom tools,reasoning) and genuine chat-completions bodies (messages), always answering in chat completions formatstreaming through the endpoint was fully broken (500 on every streaming request) and router-served streams leaked raw Responses API events (including request metadata) instead of chat chunks; both fixed
custom (grammar) tool calls, e.g. Cursor's ApplyPatch, now surface as chat
tool_callsin both streaming and non-streaming responses, and multi-turn tool round trips completeCursor Ask mode sends a genuine chat completions body whose
toolsarray mixes nested function tools with a flat Responses-style custom tool (ApplyPatch); the messages arm forwarded that verbatim so OpenAI 400d (Missing required parameter: 'tools[N].custom'), and even a correctly nested custom tool failed on the way back: litellm's response parsing 500d non-streaming and silently dropped the tool call when streaming. The messages arm now nests flat tool defs, and OpenAI chat custom tool calls are first-class across litellm's chat surface (non-streaming, streaming deltas, chunk rebuild)ApplyPatch is grammar-constrained: Cursor ships a Lark grammar in the Responses flat format shape ({"type":"grammar","definition","syntax"}) while chat completions wraps the same fields one level deeper ({"type":"grammar","grammar":{...}}), so the nested envelope alone still 400d (
tools[N].custom.format.grammar); format shapes and named tool_choice objects now translate across surfaces in both directions. Live captures further show the dialects mix PER LEVEL (Cursor sends a chat-nested envelope whose inner format is still Responses-flat), so the cursor arm normalizes each level independently and idempotently; a parametrized test pins the full envelope x format matrix. Separately, real Cursor gpt-5.6 requests exposed a routing gap in core litellm: OpenAI enables reasoning by default for gpt-5.4+ and Chat Completions rejects function tools whenever reasoning is on, but the existing responses-bridge heuristic only fired when the caller explicitly sent reasoning_effort, so tools requests without it 400d on chat instead of auto-bridging; the heuristic now treats unset effort as reasoning-active and keeps the documented reasoning_effort "none" escape hatch on chatReference behavior studied from the community Cursor-OpenAI-BYOK-Bridge (
src/byok): Cursor agent mode POSTs Responses-API-shaped bodies to the chat/completions path while expecting chat-completions SSE back, so the bridge routes those to a Responses upstream and converts the stream back; bodies withmessagespass through as genuine chat completionsLinear ticket
Resolves LIT-4395
Resolves LIT-4396
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Live proxy on
127.0.0.1:4396backed by Postgres, real provider calls. Before runs captured at214945a223(origin/litellm_internal_staging), after runs at90283fab70. The before runs used real OpenAI; the account ran out of quota mid-verification, so the after runs use real Anthropic through the same pipeline (the streaming and conversion defects are provider-independent; the two OpenAI-specific probes are marked)A. Agent-mode Responses-shaped body with
stream_options(Cursor sendsstream_options: {"include_usage": true})B. Genuine chat-completions body with tool history (what Cursor sends for models whose BYOK it already fixed)
C. Agent-mode streaming with a function tool
The tool call opens at index 0 with the role on the first delta. On the intermediate broken state (generator signature fixed but the class-identity stream gate still in place) this same curl returned raw
response.created/response.output_item.added/response.completedResponses events to the client, including litellm request metadata insideresponse.createdD. Multi-turn tool round trip (Cursor echoes
function_callandfunction_call_outputitems keyed bycall_id)E. Custom (grammar) tool call, the shape Cursor agent mode uses for ApplyPatch (real OpenAI, non-streaming; captured before quota ran out)
F. Ask-mode messages body with a flat custom tool def (the exact shape a real Cursor Ask request sent through a live gateway running the pre-fix branch; request IDs in the gateway logs)
G. Correctly nested custom tool through plain
/v1/chat/completions(proves the response-side break is core litellm, not endpoint-specific)H. Same body with
"stream": true(the worst pre-fix behavior: silent data loss, not an error)I. Grammar-constrained ApplyPatch (the real Cursor Ask-mode shape: flat grammar format inside the flat custom tool)
Named tool_choice objects follow the same surface split (Responses flat {"type":"custom","name"} vs chat nested {"type":"custom","custom":{"name"}}); the cursor arm nests flat ones, and both bridges translate them alongside the tool defs they reference (unit-pinned; live probe rides the same redeploy)
J. The exact shape real Cursor Ask mode sends (live-captured): pre-nested envelope carrying a FLAT grammar format
The reference community BYOK bridge was checked as prior art and performs no tool normalization on its chat path (messages bodies forward verbatim), so these hybrid shapes have no reference handling to mirror; the per-level matrix test is the contract
K. Function tools on gpt-5.6 without an explicit reasoning_effort (real Cursor agent shape; reproduces on plain /v1/chat/completions, so this was a core litellm gap, not a cursor-endpoint one)
Control (stays green before and after): history round trip with a nested custom tool_call plus its tool result through
/v1/chat/completionsreturns 200 (litellm forwards custom tool_calls in request history untouched; OpenAI accepts them)Raw wire shapes these fixes encode were captured live through the
/openaipassthrough (non-streaming message and the streaming delta sequence) and are pinned verbatim in the regression testsNegative control: every other
/cursor/*path still reaches the Cloud Agents passthroughSpend note: SpendLogs rows land for every request above; the Responses-pipeline rows log zero cost, which is pre-existing and tracked in #30126 with open PR #30277
Type
🐛 Bug Fix
Changes
route (
cursor_chat_completions): bodies withmessagesrun through the standard chat completions pipeline untouched (the old blindmessagestoinputrename broke tool history and chat tool defs); Responses-shaped bodies keep thearesponsespipeline with chat-completions-onlystream_optionsstrippedcursor_data_generatoraccepts therequestkwarg the processor passes (every streaming request 500d without it) and detects streams by__anext__instead of a class check that the router'sHiddenParamsAsyncIteratorWrapperdefeats (which leaked raw Responses events, metadata included, to clients)streaming converter:
custom_tool_calloutput items andcustom_tool_call_input.deltaevents become chattool_callsdeltas; tool_call indices are remapped per-stream to 0-based sequential (Responsesoutput_indexcounts reasoning and message items, so the first tool call of a reasoning model arrived at index 1 or higher and strict SSE accumulators misplace it);response.completedreportsfinish_reason: "tool_calls"forcustom_tool_callitems too. The finish check deliberately covers exactly the item types the stream converter emits tool_call deltas for; reporting tool_calls for item types never streamed (e.g. the native apply_patch tool, unhandled in the stream converter before and after this PR) would hand the client a tool_calls finish with an empty tool_calls arraynon-streaming converter: typed
ResponseCustomToolCallitems and litellm's ownGenericResponseOutputItempydantic items (what the completion bridge emits for non-Responses-native providers behind the router) convert to chat output instead of being dropped; dropping the latter raised "Unknown items in responses API response" on every router-bridged non-streaming completion through this endpointmessages arm (
cursor_chat_completions): flat Responses-style tool defs in a chat body are nested into the chat completions shape ({"type": "custom", "name", ...}to{"type": "custom", "custom": {...}}, same for flat function defs) and published through_safe_set_request_parsed_bodyso the delegatedchat_completionreads the normalized body from the request-scope cache; bodies whose tools are already chat-shaped skip the cache write entirelycore chat surface: OpenAI chat completions custom tool calls are now first-class. New
ChatCompletionMessageCustomToolCall/ChatCompletionDeltaCustomToolCallsibling types mirror the installed openai SDK union (separate classes so function tool call dumps gain nocustomkey and custom dumps carry nofunctionkey), a singlechat_completion_tool_call_from_dictdispatch feeds the three provider-dict sinks (Message.__init__,convert_to_model_response_object,_transform_choices), andDelta.__init__dispatches streamed dicts on thecustomkey so both stream re-parse sites (chunk_creator,return_processed_chunk_logic) stop swallowing custom deltas via their except branchesconsumers that assume
.functionwere audited and the unguarded ones now skip custom entries: the json-mode gate_should_convert_tool_call_to_json_mode(single chokepoint for all three json-mode callers),_handle_invalid_parallel_tool_calls, helicone and lunary logging; the chunk builder accumulatescustom.inputfragments so spend logging andstream_chunk_builderrebuild the full custom callchat to responses bridge (
_convert_tools_to_responses_format): nested chat custom tools are flattened to the Responses flat shape instead of being forwarded nested (the mirror-image gap, hit when a chat body with custom tools targets a Responses-bridged model)the cursor messages arm normalizes tool shapes PER LEVEL, not per whole-tool template: the envelope level (flat def nested under
custom/function) and the format level (flat grammar wrapped asformat.grammar) are normalized independently and idempotently, so hybrids like a pre-nested envelope with a flat grammar inside land canonical; every envelope x format combination is pinned by a parametrized testcustom tool
formatshape translation: shared helper pair inprompt_templates/common_utils(convert_custom_tool_format_to_chat_shape/convert_custom_tool_format_to_responses_shape) wraps or unwraps the grammar object; applied on the cursor messages arm (flat to chat) and the chat to responses bridge (chat to flat);{"type": "text"}is identical on both surfaces and passes through, as does anything unrecognizednamed tool_choice translation follows the tool defs on every surface: the cursor messages arm nests flat Responses-style tool_choice objects,
_normalize_tool_choice_for_responses_apiflattens chat custom tool_choice exactly like its existing function arm, and_transform_tool_choiceon the responses to chat bridge maps custom tool_choice to a function tool_choice because that bridge downgrades custom tools to function tools (a custom choice would reference a tool type absent from the converted request)core responses-bridge heuristic (
responses_api_bridge_check): for gpt-5.4+ on openai/azure with FUNCTION tools, unsetreasoning_effortnow bridges to the Responses API (OpenAI defaults reasoning on server-side, so the chat request was unservable) and explicit"none"stays on chat completions (OpenAI's documented escape hatch; the old code over-bridged that cell). The gate requires a function-type tool specifically: custom-only requests are served natively by chat completions with reasoning on (live-proven 200) and keep the native custom tool_call response shape rather than the bridge's function-shaped mapping; the pre-existing arm shared the any-tools coarseness and is fixed by the same leg. Two prior test pins asserting tools-without-reasoning stays chat encoded the unservable behavior and are flipped with the rationale in their docstringscursor input arm gains the mirror of the messages-arm normalization: chat-nested tool envelopes, chat-nested grammar formats, and chat-nested object tool_choice are flattened to the Responses dialect before dispatch (previously an object-form tool_choice in a Responses-shaped body reached OpenAI in the wrong nesting); the mirror envelope x format matrix is pinned parametrically
the bridge gate resolves the effective OpenAI base exactly as the chat handler does (call arg, then
litellm.api_base, thenOPENAI_BASE_URL/OPENAI_API_BASE, then the default) through one shared_resolve_openai_api_base, so a custom base configured only via the global or env is no longer invisible to the gate and misread as the default endpoint; only requests that would actually hit the default OpenAI endpoint (or Azure) are auto-bridgedcustom-vs-function classification of a tool-call dict goes through one shared
is_custom_tool_call_dict(explicit custom type, or a custom payload present) used by both the non-streamingchat_completion_tool_call_from_dictand the streamingDeltacoercion, and the stream assembler classifies from the accumulated custom payload rather than atypefield continuation chunks never carry; previously the same payload could parse as a custom tool call mid-stream, raise TypeError on the completed message, and be silently dropped from the assembled message. The tool envelope converter now extracts payload fields from both the nested dict and the top level (nested first) instead of treating a present nested dict as the exclusive source, so an empty nested envelope no longer drops a top-level name, and a nameless envelope passes through unchangedWhat does not change: every other
/cursor/*path still passes through to the Cursor Cloud Agents API; the/v1/responsesendpoints are untouched; the tool-index remap only activates when the per-stream map is passed, so the stateless guardrail caller of the same translate function keeps its existing behavior; function tool call parsing, serialization, and streaming shapes are byte-identical to before (pinned by the pre-existing exact-dict tests, all green); the Responses-arm mapping of custom tool calls to function-shaped chat tool calls is unchanged; the bridge heuristic for pre-5.4 GPT-5 names and the reasoning-summary arm are unchanged. One consequence worth noting: the auto-bridge applies only when the resolved base is the default OpenAI endpoint (or the provider is Azure); OpenAI-compatible backends reached through a custom api_base, whether passed per-call or configured vialitellm.api_baseorOPENAI_BASE_URL/OPENAI_API_BASE, are never auto-bridged, and reasoning_effort "none" remains the per-request escape hatch on the default endpointFinal Attestation
Note
Medium Risk
Touches core chat/Responses bridging, proxy routing, and gpt-5.4+ auto-routing; behavior changes are broad but heavily test-covered, with the main regression risk being mis-routing OpenAI-compatible backends or altering tool-call shapes clients depend on.
Overview
Cursor BYOK on
/cursor/chat/completionsnow branches on body shape: realmessagesbodies delegate to normal chat completions (with per-level normalization of flat Responses-styletools/tool_choiceand grammarformatinto chat shapes); Responses-shapedinputbodies still go througharesponseswithstream_optionsstripped without mutating the cached request body. Streaming fixes include accepting therequestkwarg, detecting streams via__anext__(not a brittle class check), and converting Responses events to chat SSE.GET /cursor/modelsand/cursor/v1/modelsdelegate to the standard model list so BYOK key verification works.Custom (grammar) tools are first-class on the chat surface: new custom tool call types,
chat_completion_tool_call_from_dict/is_custom_tool_call_dict, streaming delta assembly and chunk rebuild forcustom.input, and Responses↔chat bridges forcustom_tool_callitems (including sequential tool_call index remapping andcustom_tool_call_input.delta). Helicone/Lunary logging and related paths handle custom payloads.gpt-5.4+ routing:
responses_api_bridge_checkshares_resolve_openai_api_basewith the chat handler and auto-bridges function tools when reasoning is active (including unset effort on real OpenAI/Azure), while custom-only tool sets stay on chat andreasoning_effort: "none"remains the chat escape hatch.Reviewed by Cursor Bugbot for commit eea9bb1. Bugbot is set up for automated code reviews on this repo. Configure here.