litellm/litellm/rust/crates
paveln83 ea96ea3db5
fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output (#52116)
* fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output

* fix(anthropic): close rebuilt-stream thinking blocks with a signature_delta

* fix(anthropic): drop unsigned thinking before Claude, stream raw reasoning_text, close rebuilt thinking blocks with signature_delta

A Claude target on /v1/messages now gets unsigned thinking blocks left out of the request, so a switch from a reasoning_content model makes one call and keeps thinking, except when that would leave the final tool turn without its opening thinking block

Raw response.reasoning_text deltas from the Responses bridge stream as thinking, and a stream rebuilt from a full answer or rewritten by a guardrail closes each thinking block with a signature_delta, the real signature or an empty string

* fix(anthropic): stream a whole reasoning item as a closed thinking block

A Responses stream can send a reasoning item whole in output_item.added and output_item.done with no text deltas, as litellm's own stream does for gpt-oss on OpenRouter. The /v1/messages stream now builds that item's thinking block with the same helper the non-streamed response uses, so streamed and non-streamed answers carry the same reasoning

* test(anthropic): mark the new streaming test locals Final

* fix(anthropic): drop unsigned thinking before every Claude call, a pending tool turn included

Anthropic answers 400 to a thinking block with an empty signature but accepts a
tool turn with no thinking, so the strip no longer keeps the block that opens the
pending tool turn. The check now looks for "claude" in the model name, which covers
Claude behind every messages route and the chat adapter, not only four providers

* fix(anthropic): strip unsigned thinking when a deployment's base_model names Claude

* fix(anthropic): drop unsigned thinking for an alias whose base_model names Claude on the native messages path

The chat adapter already read base_model before leaving unsigned thinking out of a Claude request. The native messages transform and the Rust request transform now read it too, so an aliased Claude deployment gets one call instead of a 400 and a retry

* test(anthropic): build the pending tool turn without mutating it in the Rust strip test

The Rust test now builds its expected messages from the same helper instead of editing them afterward, and a doc comment that only restated a helper's name is gone

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-16 20:44:27 -08:00
..
auth
auth-aws fix(messages): close high and medium rust messages parity bugs (#52042) 2026-11-16 21:08:25 +00:00
auth-azure feat(messages): serve azure ai foundry messages on rust only (#51721) 2026-11-14 13:40:38 -08:00
auth-gcp
auth-types feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
cache
cache-azure-blob
cache-disk
cache-gcs
cache-memory fix(cache-memory): rebuild the in-memory cache on an exact expiry index (#51388) 2026-11-13 13:16:33 -08:00
cache-qdrant-semantic
cache-response
cache-s3
cache-testing
callbacks feat(custom-logger-v2): add the contract for rust callbacks and bind the proxy request scope (#51526) 2026-11-14 02:33:27 +00:00
callbacks-budgets feat(budgets): replace the python budget hold and settle engine with a rust engine admitted at auth (#51535) 2026-11-15 16:03:51 -08:00
callbacks-legacy-python feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
callbacks-python feat(custom-logger-v2): add the contract for rust callbacks and bind the proxy request scope (#51526) 2026-11-14 02:33:27 +00:00
callbacks-s3-log feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
circuit-breaker
config refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
config-load feat(config-load): resolve os.environ/ references for the gateway (#52025) 2026-11-16 09:56:32 -08:00
core-utils refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
coroutine
cost feat(model-catalog): read output_cost_per_video in the rust registry check (#51433) 2026-11-12 14:58:24 -08:00
db feat(db): take the rollup lock_timeout from the caller and keep team lock statements unnamed under PgBouncer (#51549) 2026-11-14 15:28:11 -08:00
db-testing
env refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
error
fnmatch feat(fnmatch): add a crate for Python's fnmatchcase glob dialect (#51530) 2026-11-16 18:15:47 +09:00
framer
gateway refactor(rust): drop os.environ/ stripping where config-load already resolved it (#52026) 2026-11-16 09:56:32 -08:00
gateway-auth refactor(rust): drop os.environ/ stripping where config-load already resolved it (#52026) 2026-11-16 09:56:32 -08:00
gateway-auth-core refactor(auth): plan the authentication path in Rust (#51605) 2026-11-16 19:36:57 +09:00
gateway-forward
gateway-inference refactor(rust): drop os.environ/ stripping where config-load already resolved it (#52026) 2026-11-16 09:56:32 -08:00
gateway-management
gateway-mcp refactor(rust): drop os.environ/ stripping where config-load already resolved it (#52026) 2026-11-16 09:56:32 -08:00
gateway-ui
host feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
host-http
host-native
host-python feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
http fix(messages): close high and medium rust messages parity bugs (#52042) 2026-11-16 21:08:25 +00:00
inference fix(messages): close high and medium rust messages parity bugs (#52042) 2026-11-16 21:08:25 +00:00
inference-chat feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
inference-messages fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output (#52116) 2026-11-16 20:44:27 -08:00
inference-ocr
inference-responses
inference-testing
inference-transcription
litellm
llms fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output (#52116) 2026-11-16 20:44:27 -08:00
llms-types fix(messages): close high and medium rust messages parity bugs (#52042) 2026-11-16 21:08:25 +00:00
model-catalog refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
model-catalog-refresh feat(cost-map): load LITELLM_MODEL_COST_MAP_URL from gs:// with Google application default credentials (#51108) 2026-11-12 15:22:23 -08:00
python-bridge fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output (#52116) 2026-11-16 20:44:27 -08:00
python-compat refactor: clean up fresh tech debt from 2026-11-15 window (#51996) 2026-11-16 10:08:30 -08:00
redis-client fix(proxy): keep a customer budget reset from being undone by a stale hierarchy cache entry (#51694) 2026-11-13 14:21:20 -08:00
redis-connect refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
redis-resolve refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
redis-store feat(proxy): support budget_limits windows on internal users (#51763) 2026-11-14 07:44:35 -05:00
redis-testing
redis-types
router fix(anthropic): close /v1/messages thinking blocks with a signature and keep bridged output (#52116) 2026-11-16 20:44:27 -08:00
router-core fix(bedrock)!: split the OpenAI breakpoint and Bedrock cachePoint model flags (#52180) 2026-11-16 18:50:32 -08:00
router-types feat(config-load): resolve os.environ/ references for the gateway (#52025) 2026-11-16 09:56:32 -08:00
s3 feat(s3-log): replace the python s3_v2 logger with a rust callback (#51539) 2026-11-14 23:03:58 +00:00
secret-value
secrets feat(config-load): resolve os.environ/ references for the gateway (#52025) 2026-11-16 09:56:32 -08:00
secrets-aws refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
secrets-azure refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
secrets-cyberark refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
secrets-google refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
secrets-hashicorp refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00
secrets-types
spend-clickhouse
starlette refactor(auth): decide route rules in Rust (#51531) 2026-11-16 18:55:32 +09:00
storage-clickhouse
testkit
token-counter fix(proxy): count the request's tool_choice on the token count routes (#51133) 2026-11-14 07:53:27 -05:00
token-counter-fast
token-counter-huggingface
token-counter-tiktoken
tracing perf(logging): scan opt-in spend-log tokens natively (#51770) 2026-11-15 06:09:02 +08:00
yaml refactor(rust): read config values and YAML with Python semantics (#52023) 2026-11-16 09:56:31 -08:00