litellm/litellm
shin-bot-litellm 923b1cfd92
fix: MCP "Session not found" error on VSCode reconnect (#20298)
* fix: strip stale mcp-session-id header to prevent 'Session not found' error loop

When VSCode reconnects to LiteLLM's MCP endpoint after a reload, it sends
a stale mcp-session-id header. The session was already cleaned up, causing
a 404 'Session not found' error. VSCode retries with the same stale ID,
creating an infinite error loop.

Before forwarding requests to the StreamableHTTP session manager, check if
the mcp-session-id header references a valid session. If the session doesn't
exist, strip the header so a new session is created automatically.

Fixes #20292

* refactor: extract stale session handling into _strip_stale_mcp_session_header helper
2026-02-02 14:15:31 -08:00
..
a2a_protocol [Fix] A2a Gateway - Allow supporting old A2a card formats (#19949) 2026-01-28 15:02:08 -08:00
anthropic_interface [bug fix] do not fallback to token counter if disable_token_counter is enabled (#19041) 2026-01-13 16:53:38 -08:00
assistants
batch_completion
batches litellm_fix(azure): Fix acancel_batch not using Azure SDK client initialization (#20168) 2026-01-31 11:45:25 -08:00
caching Add support for caching for responses API 2026-01-14 13:33:07 +05:30
completion_extras _add_web_search_tool 2026-01-31 11:21:40 -08:00
containers Make keepalive_timeout parameter work for Gunicorn (#19087) 2026-01-16 03:32:59 +05:30
endpoints/speech/speech_to_completion_bridge
experimental_mcp_client fix MCP client 2026-01-31 11:25:21 -08:00
files fix(mypy): fix type errors in files, opentelemetry, gemini transformation, and key management (#20161) 2026-01-31 10:09:07 -08:00
fine_tuning
google_genai Add custom vertex ai mapping to the output 2026-01-22 15:18:24 +05:30
images Add None as default image value 2026-01-19 09:08:38 +05:30
integrations Fix: Slack alert issue 2026-02-02 16:49:10 +05:30
interactions
litellm_core_utils perf: cache _get_relevant_args_to_use_for_logging() at module level (#20077) 2026-02-02 10:54:49 -08:00
llms fix: litellm_core_utils/prompt_templates/factory.py:3431 2026-02-02 19:00:12 +05:30
ocr
passthrough [Fix] VertexAI Pass through - Ensure only anthropic betas are forwarded down to LLM API (#19542) 2026-01-21 19:12:04 -08:00
proxy fix: MCP "Session not found" error on VSCode reconnect (#20298) 2026-02-02 14:15:31 -08:00
rag [Feat] RAG API - Add s3_vectors as provider on /vector_store/search API + UI for creating + PDF support for /rag/ingest (#19895) 2026-01-27 16:30:59 -08:00
realtime_api Add bedrock route in realtim main.py 2026-02-02 12:16:05 +05:30
rerank_api
responses fix: Include hidden params in chat response to responses api response transformation (#20084) 2026-02-02 18:24:21 +05:30
router_strategy
router_utils fix: prevent error when max_fallbacks exceeds available models (#20071) 2026-02-02 18:23:53 +05:30
search
secret_managers fix: make HTTPHandler mockable in OIDC secret manager tests (#19803) 2026-01-26 11:00:42 -08:00
skills
types feat: enforce model-level TPM/RPM limits (enforce_model_rate_limits) … (#19230) 2026-02-02 18:18:46 +05:30
vector_store_files
vector_stores
videos
__init__.py remove key blocking 2026-01-31 16:46:17 -08:00
_lazy_imports_registry.py fix(hosted_vllm): route through base_llm_http_handler to support ssl_verify (#19893) 2026-01-28 22:33:07 -08:00
_lazy_imports.py
_logging.py Fix: log duplication when json_logs is enabled (#19705) 2026-01-24 11:09:04 -08:00
_redis.py
_service_logger.py fix(langfuse_otel): ignore service logs and fix callback shadowing (#19298) 2026-01-19 05:53:47 -08:00
_uuid.py
_version.py
budget_manager.py
constants.py [Feat] New Model - amazon.nova-2-pro-preview-20251202-v1:0 (#20033) 2026-01-29 16:55:55 -08:00
cost_calculator.py [Feat] v2 - Logs view with side panel and improved UX (#20091) 2026-01-30 18:34:13 -08:00
cost.json
exceptions.py Fix unsafe access to request attribute (#19573) 2026-01-22 10:58:29 -08:00
main.py Fix open_ai_embedding_models to have custom_llm_provider None 2026-02-02 15:18:56 +05:30
model_prices_and_context_window_backup.json feat(vertex_ai): add global endpoint support for Qwen MaaS models 2026-02-02 18:13:10 +05:30
mypy.ini
py.typed
router.py feat: enforce model-level TPM/RPM limits (enforce_model_rate_limits) … (#19230) 2026-02-02 18:18:46 +05:30
scheduler.py Fix queue persistence to Redis (#19304) 2026-01-19 19:01:34 -08:00
timeout.py
utils.py perf: optimize wrapper_async with CallTypes caching and reduced lookups (#20204) 2026-02-02 10:42:12 -08:00