litellm/litellm
joshua-berri 5669abf824
fix(gemini): preserve distinct parallel tool calls with identical arguments (#53233)
* fix(gemini): keep identical tool calls that have distinct ids

Gemini 2.x history conversion dropped a tool call whose name and
arguments matched an earlier call in the same model turn, even when
the two calls had different ids and their own tool results. The
request then carried fewer functionCall parts than functionResponse
parts. A call with a new non-empty id is now always kept, whether it
sits next to its twin or in a following assistant message, as the
Responses API bridge produces. Replayed ids, calls without an id and
legacy function_call keep the existing content dedup.

* fix(gemini): compare tool call ids without their embedded thought signature

A tool call id can carry a Gemini thought signature after the
__thought__ separator. The emitted functionCall id and the existing
content dedup both use the id without it, so treating two signed
forms of one call id as different calls sent a replayed call twice.
Strip the signature before checking whether the id was already seen.

---------

Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com>
2026-11-20 17:01:46 -08:00
..
a2a_protocol fix(logging): retain streaming success logging tasks until they finish (#52067) 2026-11-16 11:21:05 -08:00
accounting feat(proxy): emit budget alerts for app customer scopes (#52955) 2026-11-19 16:21:09 -08:00
anthropic_interface feat(anthropic): forward message threads on native /v1/messages (#50976) 2026-11-10 18:33:54 -08:00
assistants refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
batch_completion
batches refactor(s3-log): move the rust-backed s3 logger from s3_v3 to s3_v2 (#51893) 2026-11-14 22:24:23 -08:00
caching fix(caching): preserve Responses objects on cache hits (#53188) 2026-11-20 14:38:21 -08:00
chat_completions fix(rust): run native async calls through python's async wrapper steps (#50423) 2026-11-10 00:24:20 +00:00
cli chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
completion_extras fix(responses): send bridged system prompts too long for instructions as input (#52964) 2026-11-20 11:56:47 -08:00
compression
containers
decisions fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805) 2026-11-20 13:33:36 -08:00
deploy feat(docker): install cryptography, grpcio and libpq from chainguard apks in the fips image (#52997) 2026-11-20 15:58:28 -08:00
embeddings fix(rust): run native async calls through python's async wrapper steps (#50423) 2026-11-10 00:24:20 +00:00
endpoints/speech/speech_to_completion_bridge
enterprise fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805) 2026-11-20 13:33:36 -08:00
evals
experimental_mcp_client
extraction
files refactor(vertex_ai): remove unreachable VertexAIFilesHandler.afile_content (#51966) 2026-11-15 13:54:05 -08:00
fine_tuning
google_genai fix(google_genai): honor snake_case generation_config on generateContent (#51139) 2026-11-18 03:47:08 +00:00
harness fix(responses): preserve incomplete status in synthetic streams (#52489) 2026-11-19 22:24:50 -08:00
images fix(images): honor additional_drop_params given as a tuple or holding non-string entries (#52390) 2026-11-19 09:56:32 -08:00
integrations feat(spend-logs): rust spend log callback (#52182) 2026-11-20 16:31:04 -08:00
interactions fix(responses): preserve incomplete status in synthetic streams (#52489) 2026-11-19 22:24:50 -08:00
litellm_core_utils refactor(budgets): use one budget window model for keys, teams, users and customers (#53218) 2026-11-20 16:17:05 -08:00
llms fix(gemini): preserve distinct parallel tool calls with identical arguments (#53233) 2026-11-20 17:01:46 -08:00
mcp_client fix(mcp): return an upstream -32042 URL elicitation error from /mcp as a JSON-RPC error (#52384) 2026-11-19 08:56:01 -08:00
messages feat(messages): serve bedrock claude_platform messages on rust only (#52681) 2026-11-19 14:34:02 -08:00
models refactor(budgets): use one budget window model for keys, teams, users and customers (#53218) 2026-11-20 16:17:05 -08:00
ocr fix(rust): run native async calls through python's async wrapper steps (#50423) 2026-11-10 00:24:20 +00:00
packaging fix(packaging): ship the license public key in the litellm-proxy sdist (#52970) 2026-11-19 23:18:32 +00:00
passthrough fix(bedrock): log the prompt, settings and stream flag of passthrough requests (#52146) 2026-11-16 16:10:52 -08:00
proxy feat(guardrails): hold streamed tool calls for the verdict and log prompts blocked with a reply (#51872) 2026-11-20 16:58:15 -08:00
proxy-extras fix(proxy): tolerate unavailable psycopg during migrations (#53146) 2026-11-20 11:29:41 -08:00
proxy_auth
rag refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
realtime_api feat(bedrock): derive STS session tags and session name from caller identity (#52978) 2026-11-19 17:11:09 -08:00
redis feat(auth_cache): name each auth cache object with a typed key (#52831) 2026-11-20 17:57:38 +09:00
repositories feat(spend-logs): rust spend log ledger writer (#52163) 2026-11-20 16:31:04 -08:00
rerank_api refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
responses fix(proxy): size budget reservation from route output cap fields (#51752) 2026-11-20 16:25:09 -08:00
router_rust fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805) 2026-11-20 13:33:36 -08:00
router_strategy fix(complexity-router): support optional classifier output limits (#52979) 2026-11-20 09:54:30 -08:00
router_utils fix(router): scope cooldown reads to request candidates (#52913) 2026-11-19 12:20:15 -08:00
runtime fix(gateway): honor the configured Postgres connection cap (#52729) 2026-11-19 04:10:10 +00:00
rust refactor(auth_cache): name the customer app cache families as AuthObjects (#53088) 2026-11-21 09:50:04 +09:00
rust_bridge refactor(auth_cache): name the customer app cache families as AuthObjects (#53088) 2026-11-21 09:50:04 +09:00
sandbox
scripts feat(proxy): send gateway model calls to Lens as traces when the Lens store is connected (#53042) 2026-11-20 10:12:08 -08:00
search fix(tavily): price the search depth chosen automatically (#52564) 2026-11-18 13:04:12 -08:00
secret_managers refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
skills refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
systemone
telemetry
text_completions fix: keep LiteLLM-internal params out of provider request bodies (#46083) 2026-11-16 22:20:05 -08:00
types feat(guardrails): hold streamed tool calls for the verdict and log prompts blocked with a reply (#51872) 2026-11-20 16:58:15 -08:00
ui refactor(budgets): use one budget window model for keys, teams, users and customers (#53218) 2026-11-20 16:17:05 -08:00
vector_store_files
vector_stores feat(vector_stores): add YAML-configured unified search fallbacks (#52093) 2026-11-18 08:41:02 -08:00
videos refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
vscode-extension chore: move ui and vscode-extension under litellm and delete docs (#50992) 2026-11-12 04:19:57 +00:00
__init__.py feat(bedrock): derive STS session tags and session name from caller identity (#52978) 2026-11-19 17:11:09 -08:00
_internal_context.py refactor(redis): delete the Python RedisBatch now that every request op is native (#51383) 2026-11-13 03:22:28 +00:00
_lazy_imports.py refactor: read lazy attributes with getattr instead of a TypedDict wrapper (#50543) 2026-11-07 10:56:30 -08:00
_lazy_imports_registry.py fix(decisions): support the litellm_proxy provider (#51611) 2026-11-19 11:44:40 -08:00
_logging.py feat(control_plane): --control-plane flag serves the control plane API from the existing image (#49658) 2026-11-16 17:36:24 +00:00
_process_defaults.py
_redis.py fix(redis): drop ssl_ kwargs from the async pool when ssl is off (#52344) 2026-11-17 13:23:34 -08:00
_redis_credential_provider.py
_service_logger.py
_uuid.py
_version.py
anthropic_beta_gated_fields.py fix(anthropic)!: send extra_body fields at the top level of the Messages request (#48373) 2026-11-20 06:52:56 -08:00
anthropic_beta_headers_config.json fix(bedrock): forward the compact-2026-09-04 compaction param on Invoke /v1/messages (#51223) 2026-11-11 15:10:32 -08:00
anthropic_beta_headers_manager.py fix(messages): load the anthropic beta map only when a filter has a beta to filter (#52188) 2026-11-16 20:03:08 -08:00
blog_posts.json
budget_manager.py
constants.py feat(usage-export): include key and user metadata objects in daily activity export rows (#49360) 2026-11-20 03:58:01 +00:00
cost.json
cost_calculator.py fix(cost): price a requested fireworks_ai router from its own row when Fireworks serves the base model (#52973) 2026-11-20 04:34:51 +00:00
exceptions.py feat(guardrails): hold streamed tool calls for the verdict and log prompts blocked with a reply (#51872) 2026-11-20 16:58:15 -08:00
guardrails.py
main.py fix(groq): restore Whisper transcription pricing (#52570) 2026-11-18 11:18:30 -08:00
model_prices_and_context_window_backup.json feat(cost-map): turn on Bedrock native structured output for GovCloud Claude rows (#53175) 2026-11-21 00:00:49 +00:00
policy_templates_backup.json
provider_endpoints_support_backup.json chore(docs): regenerate provider endpoints support (#53124) 2026-11-20 09:38:16 -08:00
py.typed
router.py fix(router): optionally reject raw model collisions across groups (#52895) 2026-11-19 13:36:28 -08:00
router_api.py fix(router): optionally reject raw model collisions across groups (#52895) 2026-11-19 13:36:28 -08:00
router_attempt.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
router_config.py refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
router_core.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
router_deprecated.py refactor(router): delete router code nothing calls (#52516) 2026-11-19 06:11:10 +09:00
router_host.py
router_python_host.py feat(router): queue congested provider requests by priority (#51892) 2026-11-17 21:26:21 -08:00
scheduler.py
schema.prisma fix(customer-management)!: preserve permanent budgets across temporary increases (#52787) 2026-11-19 10:55:11 -08:00
setup_wizard.py
timeout.py
tool_loop.py fix(tool_choice): accept the Responses API's flat allowed_tools layout on chat completions (#50467) 2026-11-10 13:04:06 -08:00
utils.py fix(count_tokens): count custom-named deployments with their base_model's tokenizer (#50734) 2026-11-19 21:24:13 -08:00