litellm/litellm
David Steele a3cdf6c895
fix(streaming): don't emit finish_reason on output_item.done for function_call
The response.output_item.done handler for function_call type was emitting
finish_reason='tool_calls' and a duplicate tool_call delta. This caused
premature stream termination after the first tool call in multi-tool
scenarios — downstream wrappers (e.g. AnthropicStreamWrapper) would close
the stream before subsequent tool calls arrived.

The response.completed event already inspects the response output list and
emits finish_reason='tool_calls' when function_call items are present, so
output_item.done does not need to (and must not) do so.

This mirrors the existing fix for message-type output_item.done (#17246).

Updated test_function_call_done_emits_is_finished (renamed) to assert
finish_reason=None and no duplicate delta. Updated test_text_plus_tool_calls_sequence
to match. Added test_multi_tool_call_stream_no_premature_finish which exercises
a synthetic 2-tool-call stream and verifies no premature termination.
2026-03-02 08:59:59 +00:00
..
a2a_protocol
anthropic_interface
assistants
batch_completion
batches Fix: Test connect failing for bedrock batches mode 2026-02-25 15:03:27 +05:30
caching fix(caching): store background task references in LLMClientCache._remove_key to prevent unawaited coroutine warnings 2026-02-27 21:23:56 -05:00
completion_extras fix(streaming): don't emit finish_reason on output_item.done for function_call 2026-03-02 08:59:59 +00:00
containers
endpoints/speech/speech_to_completion_bridge
evals
experimental_mcp_client
files
fine_tuning
google_genai
images fix(image_generation): propagate extra_headers to OpenAI image generation 2026-02-25 01:29:06 +08:00
integrations Merge pull request #22103 from Harshit28j/litellm_feat_datadog_metrics 2026-02-28 17:25:23 +05:30
interactions
litellm_core_utils fix: add sync streaming fallback + fix 429 for all streaming paths (#22375) 2026-02-28 15:55:05 -08:00
llms fix(featherless_ai): use correct FEATHERLESS_AI_API_KEY env var name 2026-03-01 17:11:58 +01:00
ocr Enable local file support for OCR (#22133) 2026-02-27 10:50:02 -08:00
passthrough
proxy Fix undefined kwargs in InFlightRequestsMiddleware 2026-03-01 17:23:37 -03:00
proxy_auth
rag
realtime_api fix(realtime): fix guardrails not firing for Gemini/Vertex AI and provider_config realtime WebSocket sessions (#22168) 2026-02-26 17:06:07 -08:00
rerank_api fix(bedrock): pass timeout param to bedrock rerank http client (#22021) 2026-02-24 09:32:11 -08:00
responses [Release Fix] (#22411) 2026-02-28 09:46:35 -08:00
router_strategy fix(lint): fix ruff/flake8 violations - unused imports, PLR0915, print statements (#21846) 2026-02-21 15:07:47 -08:00
router_utils fix: use atomic increment-first pattern for model RPM rate limiting 2026-02-24 09:55:07 -03:00
search
secret_managers
skills
types Add OCR guardrail_translation handler and support (#22145) 2026-02-28 17:39:36 -08:00
vector_store_files
vector_stores
videos fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
__init__.py Merge pull request #22182 from BerriAI/litellm_make_session_duration_configurable 2026-02-28 20:31:31 -08:00
_lazy_imports_registry.py
_lazy_imports.py
_logging.py
_redis.py
_service_logger.py
_uuid.py
_version.py
anthropic_beta_headers_config.json fix: enable context-1m-2025-08-07 beta header for vertex_ai provider (#21867) 2026-02-21 20:12:23 -08:00
anthropic_beta_headers_manager.py
blog_posts.json fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
budget_manager.py
constants.py Merge pull request #22182 from BerriAI/litellm_make_session_duration_configurable 2026-02-28 20:31:31 -08:00
cost_calculator.py fix(ollama): thread api_base to get_model_info + graceful fallback (#21970) 2026-02-23 21:00:37 -08:00
cost.json
exceptions.py Remove nit 2026-02-26 13:44:06 -08:00
main.py fix(embeddings): allow dimensions param passthrough via allowed_openai_params for non-text-embedding-3 OpenAI models 2026-02-26 09:59:37 +05:30
model_prices_and_context_window_backup.json fix(mcp): default available_on_public_internet to true (#22331) 2026-02-27 20:06:07 -08:00
mypy.ini
policy_templates_backup.json feat(add-new-block_code_execution-guardrail): prevent agent from executing code (#22154) 2026-02-25 22:02:14 -08:00
provider_endpoints_support_backup.json fix: add 12 missing endpoint keys to _ENDPOINT_METADATA, fix stale _schema keys in backup JSON 2026-02-26 19:18:17 -08:00
py.typed
router.py Merge pull request #22526 from BerriAI/fix/router-plr0915-noqa 2026-03-01 18:02:33 -03:00
scheduler.py
timeout.py
utils.py fix: resolve ruff PLR0915 and mypy type checking lint errors (#22359) 2026-02-28 15:43:26 -08:00