Repository navigation
fix(deps): skill-agent arms no longer fail with "No module named 'mcp'" - #897
Conversation
litellm 1.106.0-1.108.3 import mcp on every completion(tools=...), so each skill-agent arm answer from a locked install failed with No module named 'mcp' (BerriAI/litellm#46045). Raise the floor to the release with the fix and lock 1.109.1, the first one conda-forge also ships. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
c56109d to
961ef71
Compare
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com> # Conflicts: # dokimi/requirements.lock.txt
Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). CI at Review details
|
vchamarthi
left a comment
There was a problem hiding this comment.
🟢 Approved · reviewed 057f95d
Next: nothing required from @xaleryb. 1 nit optional.
Verified on 057f95d: ✅ changed tests: 1 passed, fail on main · ✅ full suite with main merged in: 23934 passed · ✅ merges onto main · 1 edge input tried
5 checks behind it, each with its evidence
| Area | What holds | How |
|---|---|---|
| Arm fix on head | tests/test_agent_arm_dependencies.py passes on the head: one test, a skill_agent: arm answers The demo widget listens on port 4242. with no error |
tests on the head |
| Arm failure on main | The same test fails on main's lock with ModuleNotFoundError: No module named 'mcp' raised from litellm/proxy/_experimental/mcp_server/catalog.py, so the test pins the failure the PR fixes |
same tests on main |
| Full ci | make ci-local exits 0 with main merged in |
full suite, main merged in |
| Merge | The PR merges onto current main with no conflict | merge onto main |
| Litellm floor | The pyproject.toml dependency floor is litellm>=1.108.4, the first release the PR's description names as fixed |
ran it, edge input (structured) |
|
|
||
|
|
||
| def test_a_skill_agent_arm_answers_with_the_locked_dependencies(offline_litellm, demo_skill): | ||
| """On litellm 1.106.6 every agent arm answer was ``agent_failed: No module named 'mcp'``.""" |
There was a problem hiding this comment.
🟡 Nit: Test docstring names litellm 1.106.6, but the main lock the test fails on is 1.108.3.
Line 39 says On litellm 1.106.6 every agent arm answer was agent_failed: No module named 'mcp'. The failure the description reports comes from main's lock, litellm 1.108.3, and the module docstring gives the range 1.106.0 to 1.108.3. Expected: the version the failure was seen on, 1.108.3, or the range from the module docstring.
Fix, run on 057f95d: the quoted text is gone; tests and lint are no worse.
| """On litellm 1.106.6 every agent arm answer was ``agent_failed: No module named 'mcp'``.""" | |
| """On litellm 1.108.3 every agent arm answer was ``agent_failed: No module named 'mcp'``.""" |
There was a problem hiding this comment.
Fixed in 77ec38c: the docstring names the affected range, 1.106.0 through 1.108.3, as the module docstring does; main lock (1.108.3) is in it.
Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…one release Main's lock moved to 1.108.3, which fails the same way; the module docstring already gives 1.106.0 through 1.108.3. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
Summary
From a locked install, every
skill-agent:arm answer fails withagent_failed: No module named 'mcp'. The run still prints[1/1] Q1 OKandarms runexits 0, so the batch looks healthy and the arm scores as if the agent had answered nothing.Cause: litellm 1.106.0 through 1.108.3 import
mcp.typeson anycompletion(tools=...).main.pytakes theif not skip_mcp_handler and tools:branch, which importsresponses/mcp/litellm_proxy_mcp_handler, which importsproxy/_experimental/mcp_server/catalog.py, which doesfrom mcp.types import CacheableResult.mcpis only in litellm'sproxy/mcpextras, so a base install does not have it. It is fixed upstream in 1.108.4 and later (BerriAI/litellm#45961, backported in BerriAI/litellm#50605, merged 2026-11-09; reports: BerriAI/litellm#46045, BerriAI/litellm#50781). Our lock moved onto 1.106.0 on 2026-10-26 (#224), and #798 has since movedrequirements.lock.txtto 1.108.3, which is still affected. Since 2026-10-26, the agent arms have not worked fromrequirements.lock.txtorci/conda-lock/.The fix raises the floor to the first fixed release and locks 1.109.1. Rejected alternatives:
mcpas a runtime dependency: it brings 13 packages (starlette, uvicorn, sse-starlette, python-multipart among them) into the base install, which goes against fix(deps): take ragas, langchain and diskcache out of the CI/dev lock #245 (ragas moved out of the base install to reduce the CVE surface)._skip_mcp_handler: a private argument that can change in any release.litellm<1.106: this stays on an old release and blocks the upstream fix.Changes
litellm>=1.108.4(was>=1.105.0) inrequirements.txt,requirements-test.txt,pyproject.tomlandconda-recipe/meta.yaml. No other file lists the spec.requirements.lock.txt:litellm==1.109.1(was 1.108.3). The only other change is thepython_full_version < '3.15'marker that 1.109.1 adds to itsfastuuidrequirement, plus a# via litellmline. Every other pin is the same as on main.ci/conda-lock/linux-64-py3.{11,12,13,14}.txt: litellm1.106.0becomes conda-forge1.109.1.async-timeoutdrops out because 1.109.1 no longer requires it on Python 3.11 and later. The# specs:header carries the new floor. Every other record is the same build as on main.tests/test_agent_arm_dependencies.py: runs askill_agent:arm through the reallitellm.completionwithmock_response. This sends nothing over the network, but it imports what a call with tools imports. The test fails on main's lock and passes with this one.Fixed).Why 1.109.1
conda-forge skipped 1.108.x (1.106.0 on 2026-10-21, then 1.109.0 on 2026-11-11 and 1.109.1 on 2026-11-12). 1.109.1 is the oldest fixed release that both PyPI and conda-forge ship, so the pip lock and the conda locks pin the same version.
Both locks admit only releases at least 7 days old (
--exclude-newer=P7Din the uv header,--min-age-days 7inci/lock.py), and 1.109.1 cleared that on 2026-11-19 at 10:47 UTC. Both locks in this PR are the output of their canonical commands:requirements.lock.txt: the exact command in its header (uv 0.13.7, the versionrequirements-ci.lock.txtpins), run on 2026-11-19 over main's lock, gives this file.ci/conda-lock/:python ci/lock.py --if-stalereports all four files current, and the litellm-only solve at--min-age-days 7reproduces them byte for byte.Risk
This changes litellm only, from 1.106.x to 1.109.1, for every LLM call Dokimi makes. The full suite passes on the new lock, and an agent arm answered end to end on Bedrock.
pip install dokimiusers with an older litellm get the new floor on their next upgrade. The changelog entry tells them to re-run affectedarms runbatches.1.109.1 declares
filelock<5, so thefilelock>=4.2.1override and the--no-depsinstalls that SECURITY.md describes are no longer needed (pip checkis clean on the new lock). This PR leaves both alone. They are follow-up 1 below.Testing
On Python 3.13.18 (Linux x86_64), on the branch merged with main, in a venv built from the new
requirements.lock.txtwithpip install --no-deps --require-hashes -r requirements.lock.txt -r requirements-ci.lock.txt:commands/repo.pygrowth cap, fixed by refactor(repo): move the repo reach group out of commands/repo.py #1024).tests/test_agent_arm_dependencies.py: fails in a venv from main's lock (litellm 1.108.3): the arm's answer isagent_failed: No module named 'mcp', raised fromlitellm/proxy/_experimental/mcp_server/catalog.py. Passes in the new venv, and passes in a conda env created from the newlinux-64-py3.13.txt.ruff check .,mypy(453 files),scripts/check_growth.py --report,scripts/check_comment_blocks.py,scripts/check_changelog_fragment.py,scripts/check_test_narrowing.py,scripts/check_duplicates.py,python -m dokimi.schema_compat --base origin/main,deptry .,scripts/check_docs_review_triggers.py: all clean.pip-audit.ymlruns it over all six locks: no known vulnerabilities. osv-scanner 2.7.1 withosv-scanner.tomlonrequirements.lock.txt: no issues.micromamba create --filesucceeds for all fourci/conda-lockfiles, and each env imports litellm 1.109.1.cli.py arms run --product demo --questions q.json --arms skill-agent:<demo skill> --model us.anthropic.claude-haiku-5-5 --provider amazon-bedrock --max-iterations 2. On main the answer isagent_failed: No module named 'mcp'withQ1 OKand rc 0. On this branch the answer is "The demo widget uses port 4242." after 2 model calls, with noagent_failed.Open questions
python ci/lock.pyre-solve would also move about 15 unrelated packages per file (boto3, datasets, filelock 3.32.6 to 4.2.9, regex, ...). I left that to Monday'sconda-lock.ymlrefresh. Say so if you would rather this PR carry the full re-solve.Revert
Revert the commit. The floors and both locks return to litellm 1.105.0/1.106.x, and the agent arms fail again as described above. No stored records or schema versions are involved.
Follow-ups (separate PRs)
requirements-overrides.txt(filelock>=4.2.1), the--overrideflag in both lock headers and the--no-depsinstalls, and update the filelock paragraph of SECURITY.md: litellm 1.109.1 allows filelock 4.arms runreportsOKand exits 0 when an arm answer isagent_failed. That is why this breakage went unnoticed for three weeks.Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to ([Bug]: "ModuleNotFoundError: No module named 'mcp'" BerriAI/litellm#46045).github/.licenserc.yaml)