fix(reasoning): detect bare READY markers and honor the last decision - #6754
fix(reasoning): detect bare READY markers and honor the last decision#6754Kyou12138 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 |
|
Blocked on updating this branch to latest To unblock (one-time, on machine with Kyou12138 login): Or click Update branch in the GitHub UI (if the browser session has full permissions). |
|
Superseded by rebased PR #6882 (CountClaw fork; rebased onto latest main — original fork push blocked by missing |
|
Closing in favor of rebased #6882. |
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.