fix: relax openai version constraint to allow newer SDK versions #4301
+54
−1
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.
Summary
Fixes #4300 - The
openaidependency was pinned too strictly (~=1.83.0which resolves to>=1.83.0,<1.84.0), causing dependency resolution failures when users try to install CrewAI alongside packages that require newer OpenAI SDK versions (e.g.,langchain-openai>=1.0.3requiresopenai>=1.109.1).This PR relaxes the constraint to
>=1.83.0,<2, allowing any 1.x version while protecting against potential breaking changes in a future 2.0 release.Changes:
openaidependency from~=1.83.0to>=1.83.0,<2inlib/crewai/pyproject.tomluv.lockReview & Testing Checklist for Human
<2assumes OpenAI SDK 2.0 (if/when released) may have breaking changes. Confirm this is the desired behavior.openai>=1.90.0and run the test suite to verify actual compatibility, not just import availability.Recommended test plan:
Notes
Note
Medium Risk
Broadens the allowed
openaiSDK range, which could expose the project to subtle API behavior changes across 1.x versions despite added canary tests.Overview
Relaxes the
openaidependency constraint inpyproject.tomlfrom a tight~=1.83.0pin toopenai>=1.83.0,<2to allow newer 1.x SDK versions.Adds two new OpenAI SDK “canary” tests in
tests/llms/openai/test_openai.pythat validate key CrewAI-used imports remain present and thatOpenAI/AsyncOpenAIclients still instantiate with expectedchat.completionssurfaces.Written by Cursor Bugbot for commit 78de203. This will update automatically on new commits. Configure here.