Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR updates three async execution paths to use ChangesAsync Event Loop Context Refactor
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This PR is stale because it has been open for 45 days with no activity. |
|
Hi maintainers, just keeping this from going stale. I’m still happy to revise or close this if the async-loop cleanup is no longer useful. Thanks for all the work on crewAI. |
|
This PR is stale because it has been open for 45 days with no activity. |
|
Thanks for the pull request. First-time contributors need an associated open issue before we can review a PR.
See the contributing guide. |
Summary
asyncio.get_event_loop()withasyncio.get_running_loop()in async execution pathsProblem
asyncio.get_event_loop()is legacy behavior in modern Python and can warn or behave differently when no loop is set on the current thread. These call sites are already inside async execution paths, so the running event loop is the loop they need.Before / After
Before, async code asked asyncio for the current event loop policy result with
get_event_loop().After, the code explicitly uses the active running loop with
get_running_loop(), matching the async context these functions run in.Verification
python -m compileall -q lib\crewai\src\crewai\tools\structured_tool.py lib\crewai\src\crewai\utilities\streaming.py lib\crewai\src\crewai\rag\chromadb\client.pygit diff --checkSummary by CodeRabbit