Repository navigation
Conversation
LiteLLM 1.108.3 imported its proxy MCP gateway on every completion() that passed tools; that module needs mcp>=2.3 (mcp.types.CacheableResult), but the lock keeps mcp 1.23.2 for smolagents/mcpadapt, so every live agent run failed with ImportError. 1.108.25 (same LTS line) only imports the gateway when tools reference it. Only litellm changes in uv.lock; uv audit advisory count unchanged. Adds offline regression tests using LiteLLM mock_response.
This was referenced Dec 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: model alias refresh in #10, which can merge independently and is live-verified together with this fix.
Summary
LiteLLM 1.108.3 imports its proxy MCP gateway on every
completion()that passestools, which everyToolCallingAgentstep does. That module needsmcp.types.CacheableResult, which only exists inmcp>=2.3. This project locksmcp1.23.2 for smolagents/mcpadapt, so the import fails:LiteLLM 1.108.25, on the same LTS line Plan 005 chose, adds a guard,
may_name_litellm_mcp_gateway(tools), so the gateway is only imported when the tools may reference it:Changes:
uv.lock: LiteLLM 1.108.3 → 1.108.25. No other package changes;mcpstays at 1.23.2.tests/test_litellm_tool_calls.py: 2 offline regression tests using LiteLLM'smock_response(no network, no key). One covers a directlitellm.completion(tools=...)call, the other thesmolagents.LiteLLMModel.generate(tools_to_call_from=...)path agents use.docs/PLANS.md: dependency note next to the Plan 005 entry.CI did not catch this because unit tests mock the model and no CI step makes a tool-calling completion. The new tests close that gap.
Evidence
master, LiteLLM 1.108.3):agentic-internet run "..." --model deepseek-v4.1-flashfails at step 1 withcannot import name 'CacheableResult' from 'mcp.types'.ImportError:2 failed.2 passed.master: 250 + 1). Ruff, ruff format, mypy (30 files),uv lock --check, and golden principles are clean.web_search(4×) andweb_scraper(1×), ending with the answer "The latest stable Python 3 release is Python 3.15.2, according to https://www.python.org/downloads/." The success criterion is this answer, not the exit code: the CLI currently exits 0 even when a task fails, a known defect pinned in RTM-0: characterization tests, hermetic test lane, locked CI, and runtime ADR (proposed) #8.uv audit --locked: 158 advisories on the same lock resolution before and after the bump, none for LiteLLM.Alternatives tried and rejected:
mcpto 2.3.0streamablehttp_client, whichmcp2.x removed, and no mcpadapt release supportsmcp2.x yet. It also drops thewsextra that mcpadapt requests._skip_mcp_handlerflagMerge Danger
Door: two-way
Reverting restores LiteLLM 1.108.3, along with the broken tool-calling path.
Blast Radius: Dependencies
UserWarnings raised while LiteLLM's own type definitions load. They are third-party, not deprecations, and harmless.OPENROUTER_API_KEY. A stale key gives401 User not found, which is unrelated to this fix.