crewai - ✅(Solved) Fix Request for Python 3.14 Compatibility and Estimated Release Timeline [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
crewAIInc/crewAI#5109Fetched 2026-04-08 01:40:06
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×1cross-referenced ×1labeled ×1referenced ×1

Fix Action

Fixed

PR fix notes

PR #5110: fix: add Python 3.14 compatibility (asyncio.get_running_loop)

Description (problem / solution / changelog)

Summary

Python 3.14 changed asyncio.get_event_loop() to raise RuntimeError when no running event loop exists, instead of silently creating one (completing a deprecation cycle started in 3.10). This PR:

  1. Replaces all asyncio.get_event_loop() calls with asyncio.get_running_loop() across 8 files in both crewai core and crewai-tools. All call sites were already inside async functions, so get_running_loop() is the correct replacement.
  2. Updates requires-python from <3.14 to <3.15 in all 4 pyproject.toml files.
  3. Adds 11 tests verifying the async compatibility of CrewStructuredTool.ainvoke, create_streaming_state, and ChromaDBClient._alocked.
  4. Regenerates uv.lock for the updated Python version constraint.

Closes #5109

Review & Testing Checklist for Human

  • browser_toolkit.py patched_run (line 97): This is a sync wrapper that calls get_running_loop() then loop.run_until_complete(). The old get_event_loop() would create a loop when called from a non-async context; get_running_loop() will raise RuntimeError instead. The except Exception block catches this, but verify that the fallback behavior is acceptable for all callers of patched_run.
  • browser_toolkit.py _nest_current_loop (line 542): The if loop.is_running() guard was removed. This is logically safe since get_running_loop() only succeeds when a loop is running, but confirm no subtle difference exists.
  • uv.lock diff: Lock file was fully regenerated. Skim for unexpected dependency version bumps unrelated to this change.
  • Missing test coverage for crewai-tools changes: The new tests only cover crewai core modules. The browser_toolkit, browser_session_manager, and snowflake_search_tool changes are not directly tested — verify these manually or confirm CI covers them.

Recommended test plan: Run the full test suite on Python 3.13 to confirm no regressions. If a Python 3.14 alpha/beta is available in CI, run tests there as well to validate the fix end-to-end.

Notes

  • All 8 replaced call sites were already inside async def functions, making get_running_loop() a safe 1:1 replacement.
  • No usage of removed Python 3.14 AST nodes (ast.Num, ast.Str, etc.) was found in the codebase.
  • A follow-up formatting fix was applied to browser_toolkit.py to pass the ruff format --check CI gate.

Link to Devin session: https://app.devin.ai/sessions/97cbdc58d7bc441d9f59eda15351fadd

Changed files

  • lib/crewai-files/pyproject.toml (modified, +1/-1)
  • lib/crewai-tools/pyproject.toml (modified, +1/-1)
  • lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_session_manager.py (modified, +1/-1)
  • lib/crewai-tools/src/crewai_tools/aws/bedrock/browser/browser_toolkit.py (modified, +9/-12)
  • lib/crewai-tools/src/crewai_tools/tools/snowflake_search_tool/snowflake_search_tool.py (modified, +1/-1)
  • lib/crewai/pyproject.toml (modified, +1/-1)
  • lib/crewai/src/crewai/cli/memory_tui.py (modified, +1/-1)
  • lib/crewai/src/crewai/rag/chromadb/client.py (modified, +1/-1)
  • lib/crewai/src/crewai/tools/structured_tool.py (modified, +1/-1)
  • lib/crewai/src/crewai/utilities/streaming.py (modified, +1/-1)
  • lib/crewai/tests/test_python314_compat.py (added, +210/-0)
  • lib/crewai/tests/utilities/events/test_shutdown.py (modified, +1/-1)
  • pyproject.toml (modified, +1/-1)
  • uv.lock (modified, +4732/-4541)
RAW_BUFFERClick to expand / collapse

Feature Area

Core functionality

Is your feature request related to a an existing bug? Please link it here.

Hi, thank you for your work on Crew AI!

I would like to know when you are planning to release a version compatible with Python 3.14. Is there an estimated timeline for this?

Thanks!

Describe the solution you'd like

I would like Crew AI to be officially compatible with Python 3.14, including updates to dependencies, tests, and documentation. Ideally, this would mean releasing a new version of Crew AI that supports Python 3.14. If possible, please provide guidance or a timeline for when this compatibility might be achieved.

Describe alternatives you've considered

No response

Additional context

No response

Willingness to Contribute

Yes, I'd be happy to submit a pull request

extent analysis

Fix Plan

To add support for Python 3.14, we need to update dependencies, tests, and documentation. Here are the steps:

  • Update setup.py to include Python 3.14 in the supported versions:

import sys

if sys.version_info.major == 3 and sys.version_info.minor >= 14: # Add Python 3.14 specific code if needed pass

* Update `pyproject.toml` or `setup.cfg` to include Python 3.14 in the testing matrix:
  ```toml
[tool.pytest.ini_options]
addopts = "--python=3.14"
  • Update dependencies to versions compatible with Python 3.14:

pip install --upgrade -r requirements.txt

* Run tests with Python 3.14 to ensure compatibility:
  ```bash
python3.14 -m pytest
  • Update documentation to reflect Python 3.14 support.

Verification

To verify the fix, run the tests with Python 3.14 and check that all tests pass:

python3.14 -m pytest

Check the documentation for updates on Python 3.14 support.

Extra Tips

  • Make sure to test the application thoroughly with Python 3.14 to catch any potential issues.
  • Consider adding a CI/CD pipeline to automate testing with Python 3.14.
  • Update the README.md file to reflect Python 3.14 support.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING