Repository navigation
test(crewai): install a litellm that crewAI 1.15.31+ can load - #290
Merged
Merged
Conversation
Since crewAI 1.15.31 (2026-10-27), the 11 crewai tests whose agents use "openai/qwen-turbo" fail on every Python with "Unable to initialize LLM with model 'openai/qwen-turbo'. ... the LiteLLM fallback package is not installed", although litellm 1.95.0 is installed. crewAI has no native model named qwen-turbo, so it serves that model through its LiteLLM fallback. crewAI 1.15.31 (crewAIInc/crewAI#8676) made the fallback import ChatCompletionDeltaCustomToolCall from litellm.types.utils, which litellm added in 1.97.0, and it reports the ImportError as LiteLLM not being installed. The tests' aiohttp<3.12 cap held litellm at 1.95.0: every later release needs aiohttp 3.14.2 or later. Drop the aiohttp cap and require litellm 1.97.0 or later. vcrpy has supported aiohttp 3.14 since 8.2.0; CI installs 8.5.0 on Python 3.10 and 9.2.0 on later versions. crewai[litellm] would not do: crewAI pins litellm 1.100.4 there, which fails to import on Python 3.10. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN
github-actions
Bot
requested review from
123liuziming,
Cirilla-zmh and
ralf0131
October 28, 2026 10:27
This was referenced Oct 28, 2026
Contributor
Author
|
@sipercai @ralf0131 CI is green here. 🤖 Generated with Claude Code |
ralf0131
approved these changes
Oct 28, 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.
Description
Since crewAI 1.15.31 (2026-10-27), the crewai jobs fail on every Python version: the 11 tests whose agents use
openai/qwen-turboraiseImportError: Unable to initialize LLM with model 'openai/qwen-turbo'. ... the LiteLLM fallback package is not installed, even though litellm 1.95.0 is installed.mainfails the same way (run 40613512657).crewAI has no native model named
qwen-turbo, so it serves that model through its LiteLLM fallback. crewAI 1.15.31 (crewAIInc/crewAI#8676) made the fallback importChatCompletionDeltaCustomToolCallfromlitellm.types.utils. litellm added that name in 1.97.0, and crewAI reports theImportErroras LiteLLM not being installed. The tests'aiohttp<3.12cap held litellm at 1.95.0, because every later litellm release needs aiohttp 3.14.2 or later.This PR drops the cap from the crewai test requirements and requires litellm 1.97.0 or later. Alternatives that don't work:
crewai[litellm]: crewAI pins litellm 1.100.4 there, and that release fails to import on Python 3.10 (NotRequiredfromtyping, [Bug]: import litellm fails on Python 3.10 — NotRequired imported from stdlib typing without fallback BerriAI/litellm#38076).LLM(model="openai/qwen-turbo", base_url=...)): this avoids litellm, but crewAI then uses native function calling. The recorded ReAct cassettes no longer drive tool calls, and native tool calls bypassToolUsage._use, so no TOOL span is produced (test_tool_call_with_errorfails).vcrpy has supported aiohttp 3.14 since 8.2.0. CI installs vcrpy 8.5.0 on Python 3.10 and 9.2.0 on later versions.
Type of change
How Has This Been Tested?
tox -c tox-loongsuite.ini -e py3{10,11,12,13}-test-loongsuite-instrumentation-crewai -- -raas CI runs it (tox-uv 1.35.2, GitHub CPython 3.10.22/3.11.18/3.12.16/3.13.18), which installed crewai 1.15.32, litellm 1.106.5 and aiohttp 3.14.5: 48 passed on each version. The same envs also passed offline (bwrap --unshare-net): 1 run each, plus 5 more on 3.12 and 3 more on 3.10.--exclude-newer), offline, Python 3.12:main: 48 passed with crewai 1.15.30, and 11 failed with crewai 1.15.32 (the CI failure);mainwith crewai 1.15.30 as on this branch with crewai 1.15.32.tox -c tox-loongsuite.ini -e lint-loongsuite-instrumentation-crewai(Python 3.13) andtox -e precommit(Python 3.11) pass.Does This PR Require a Core Repo Change?
Checklist:
🤖 Generated with Claude Code
https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN