fix(crew): preserve replay data after kickoff_for_each_async - #6705
Open
bardock-2393 wants to merge 1 commit into
Open
fix(crew): preserve replay data after kickoff_for_each_async#6705bardock-2393 wants to merge 1 commit into
bardock-2393 wants to merge 1 commit into
Conversation
run_for_each_async (shared by kickoff_for_each_async and akickoff_for_each) reset the shared replay store immediately after gathering results, discarding every input copy's persisted output. Removes the trailing reset so at least one run's output survives for replay, matching the fix already applied to the synchronous kickoff_for_each in crewAIInc#6650. Contributes to crewAIInc#6704
Author
|
Per CONTRIBUTING.md, this should carry the |
|
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 (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughChangesAsync replay persistence
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Contributes to #6704 by preserving replay data after
kickoff_for_each_async()/akickoff_for_each()complete.Both methods share
run_for_each_async(). Each crew copy resets and repopulates the shared replay store as part of its own run, butrun_for_each_async()then reset that same shared storage again right after gathering all the copies' results, discarding whatever they had just persisted — every call left the store empty. Removing that trailing reset is the async counterpart of the fix for #6650, which only covered the synchronouskickoff_for_each().Because the copies run concurrently on separate threads against one shared SQLite-backed store, which copy's output survives isn't deterministic the way it is for the sequential
kickoff_for_each()(guaranteed last-input-wins). This PR only fixes the unconditional wipe-to-empty; it doesn't attempt to add ordering guarantees for the concurrent case, which is a separate, harder problem.Testing
uv run pytest lib/crewai/tests/test_crew.py::test_kickoff_for_each_async_persists_output_for_replay -quv run pytest lib/crewai/tests/test_crew.py -q(132 passed, 1 skipped)uv run pytest lib/crewai/tests/crew/ lib/crewai/tests/skills/ -q(161 passed)uv run ruff check lib/crewai/src/crewai/crews/utils.py lib/crewai/tests/test_crew.pyuv run ruff format --check lib/crewai/src/crewai/crews/utils.py lib/crewai/tests/test_crew.pyuv run mypy lib/crewai/src/crewai/crews/utils.py