litellm/litellm
Julio Quinteros Pro e8301829cd Fix flaky MCP streaming test by properly mocking inner aresponses call
The test_streaming_mcp_events_validation test was flaky because:
1. It didn't mock the nested aresponses() call inside the iterator's
   _create_initial_response_iterator(), causing real API calls that fail
   without credentials
2. The iterator silently swallowed exceptions and set phase="finished",
   discarding pre-generated MCP discovery events
3. The _execute_tool_calls mock had wrong signature (missing tool_server_map)

Production fix: MCPEnhancedStreamingIterator no longer sets phase="finished"
on LLM call failure — it falls through to emit MCP discovery events first.

Test fix: Added mock for litellm.responses.main.aresponses returning a fake
async streaming iterator, fixed mock signatures, removed try/except that
masked failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 11:09:24 -03:00
..
a2a_protocol Agent Tracing - support context_id based trace id propogation + nested llm calls (#22626) 2026-03-03 18:19:12 -08:00
anthropic_interface
assistants
batch_completion
batches Merge pull request #22765 from BerriAI/main 2026-03-04 17:40:42 +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 merge: resolve conflict with upstream/main in presidio.py 2026-03-02 17:40:22 -03:00
containers
endpoints/speech/speech_to_completion_bridge
evals
experimental_mcp_client added configurable env for mcp timeouts (#22287) 2026-03-02 13:13:41 -08:00
files Merge pull request #22765 from BerriAI/main 2026-03-04 17:40:42 +05:30
fine_tuning Fix: Azure ai finetuning api 2026-03-03 10:48:00 +05:30
google_genai
images Merge branch 'litellm_oss_staging_02_27_2026' of https://github.com/BerriAI/litellm into litellm_oss_staging_02_27_2026 2026-02-28 09:54:56 -03:00
integrations Merge pull request #22765 from BerriAI/main 2026-03-04 17:40:42 +05:30
interactions
litellm_core_utils Agent Tracing - support context_id based trace id propogation + nested llm calls (#22626) 2026-03-03 18:19:12 -08:00
llms Merge pull request #22752 from BerriAI/litellm_search_api_add 2026-03-04 18:29:10 +05:30
ocr Enable local file support for OCR (#22133) 2026-02-27 10:50:02 -08:00
passthrough
proxy Merge pull request #22744 from BerriAI/litellm_mcp_streaming_fix 2026-03-04 18:29:48 +05:30
proxy_auth
rag
realtime_api fix(azure): forward realtime_protocol from config and relax api_version check for GA path (#22369) 2026-03-02 19:21:27 +05:30
rerank_api
responses Fix flaky MCP streaming test by properly mocking inner aresponses call 2026-03-04 11:09:24 -03:00
router_strategy
router_utils Fix encrypted content streaming affinity issue 2026-03-03 18:37:22 +05:30
search
secret_managers
skills
types Merge pull request #22752 from BerriAI/litellm_search_api_add 2026-03-04 18:29:10 +05:30
vector_store_files
vector_stores
videos
__init__.py Merge pull request #22559 from BerriAI/litellm_responses_websocket 2026-03-04 17:57:34 +05:30
_lazy_imports_registry.py fix(openrouter): register OpenRouter as native Responses API provider (#22355) 2026-03-02 22:02:59 -08:00
_lazy_imports.py
_logging.py
_redis.py
_service_logger.py
_uuid.py
_version.py
anthropic_beta_headers_config.json
anthropic_beta_headers_manager.py
blog_posts.json
budget_manager.py
constants.py added configurable env for mcp timeouts (#22287) 2026-03-02 13:13:41 -08:00
cost_calculator.py fix(transcription): store duration in _hidden_params to avoid OpenAI SDK deserialization issues 2026-02-26 16:06:08 -03:00
cost.json
exceptions.py Remove nit 2026-02-26 13:44:06 -08:00
main.py Merge pull request #22552 from shanemort1982/fix/register-model-custom-pricing-fields 2026-03-03 22:40:45 -03:00
model_prices_and_context_window_backup.json Add Support for OpenAI's Chat-GPT 5.3 Chat model (#22693) 2026-03-03 20:27:05 -08:00
mypy.ini
policy_templates_backup.json
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 #22740 from BerriAI/litellm_fix_file_wild_card 2026-03-04 18:30:00 +05:30
scheduler.py
timeout.py
utils.py Merge pull request #22752 from BerriAI/litellm_search_api_add 2026-03-04 18:29:10 +05:30