Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 29, 2026

Summary

Fixes #4300 - The openai dependency was pinned too strictly (~=1.83.0 which 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.3 requires openai>=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:

  • Updated openai dependency from ~=1.83.0 to >=1.83.0,<2 in lib/crewai/pyproject.toml
  • Added two compatibility tests that verify all OpenAI SDK imports used by CrewAI are available
  • Regenerated uv.lock

Review & Testing Checklist for Human

  • Verify the version constraint is appropriate: The upper bound <2 assumes OpenAI SDK 2.0 (if/when released) may have breaking changes. Confirm this is the desired behavior.
  • Test with a newer OpenAI SDK version: Install a version like openai>=1.90.0 and run the test suite to verify actual compatibility, not just import availability.
  • Review uv.lock changes: The lock file was regenerated and includes many transitive dependency updates - verify these are acceptable.

Recommended test plan:

# Install with a newer openai version to verify the fix works
uv add "crewai[tools]" "langchain-openai>=1.0.3"
# Run the new compatibility tests
uv run pytest lib/crewai/tests/llms/openai/test_openai.py::test_openai_sdk_imports_compatibility lib/crewai/tests/llms/openai/test_openai.py::test_openai_sdk_client_instantiation -v

Notes


Note

Medium Risk
Broadens the allowed openai SDK range, which could expose the project to subtle API behavior changes across 1.x versions despite added canary tests.

Overview
Relaxes the openai dependency constraint in pyproject.toml from a tight ~=1.83.0 pin to openai>=1.83.0,<2 to allow newer 1.x SDK versions.

Adds two new OpenAI SDK “canary” tests in tests/llms/openai/test_openai.py that validate key CrewAI-used imports remain present and that OpenAI/AsyncOpenAI clients still instantiate with expected chat.completions surfaces.

Written by Cursor Bugbot for commit 78de203. This will update automatically on new commits. Configure here.

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

- Change openai dependency from ~=1.83.0 to >=1.83.0,<2
- Add tests to verify OpenAI SDK imports compatibility
- Add test to verify OpenAI client instantiation

Fixes #4300

Co-Authored-By: João <joao@crewai.com>
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1769675860-relax-openai-version-constraint branch from b205758 to 78de203 Compare January 29, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Title: Dependency constraints in pyproject.toml are overly strict

0 participants