Files
litellm/tests
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
..
2026-01-20 18:37:56 +05:30
2026-01-11 08:00:31 -08:00
2026-01-31 19:08:07 -08:00
2026-01-22 10:50:23 -08:00
2026-01-02 17:38:52 +09:00
2026-01-22 15:21:44 -08:00
2026-01-24 13:17:32 -08:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.