fix(reasoning): detect bare READY markers and honor the last decision - #6754
Open
Kyou12138 wants to merge 2 commits into
Open
fix(reasoning): detect bare READY markers and honor the last decision#6754Kyou12138 wants to merge 2 commits into
Kyou12138 wants to merge 2 commits into
Conversation
Planning readiness only matched the full instructional phrase "READY: I am ready to execute the task.", so models that conclude with a short-form READY line (common with Ollama/local models) were stuck in endless refine loops. Introduce response_indicates_ready() that accepts the full phrase and line-anchored READY / NOT READY markers, with the last marker winning. Closes crewAIInc#6204
|
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)
📝 WalkthroughWalkthroughThe reasoning handler adds shared detection for READY and NOT READY markers. Three response paths use this detector. Tests cover marker formats, precedence, false positives, empty responses, and planning parser integration. ChangesReadiness detection
🚥 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
Fixes #6204.
Reasoning plan refinement only treated the full instructional phrase
READY: I am ready to execute the task.as ready. Local/Ollama models often conclude with a short line such asREADY/READY./NOT READY, so the executor never left the refine loop even when the model had clearly finished planning.Approach
Introduce
response_indicates_ready()with:READY/NOT READY(optional trailing punctuation), case-insensitiveNOT READY→READY, or the reverse)I am ready to begin researching…is not treated as readyThis is intentionally stricter than “substring contains READY”, which would mis-handle
NOT READY.Tests
lib/crewai/tests/utilities/test_response_indicates_ready.pycovers:READY/READY./READY: …NOT READYmust not match as readyHow to test
cd lib/crewai pytest tests/utilities/test_response_indicates_ready.py -qNotes / related PRs
Several community PRs also target #6204. Differentiation of this PR:
Happy to close in favor of another PR if maintainers prefer a different approach.