Strip internal planning tags from PlanReActPlanner output content blocks - #6709
Open
guptaishaan wants to merge 1 commit into
Open
Strip internal planning tags from PlanReActPlanner output content blocks#6709guptaishaan wants to merge 1 commit into
guptaishaan wants to merge 1 commit into
Conversation
`PlanReActPlanner.process_planning_response` returned raw text that still contained the internal `/*PLANNING*/`, `/*REASONING*/`, `/*ACTION*/`, `/*REPLANNING*/`, and `/*FINAL_ANSWER*/` markers, forcing callers to parse those artefacts themselves. Signed-off-by: Ishaan <ishaangupta0408@gmail.com>
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.
PlanReActPlanner.process_planning_responsereturned raw text that still contained the internal/*PLANNING*/,/*REASONING*/,/*ACTION*/,/*REPLANNING*/, and/*FINAL_ANSWER*/markers, forcing callers to parse those artefacts themselves.This PR adds a
_strip_leading_planning_taghelper that removes the leading marker from each text block before it is emitted, so consumers receive clean content blocks. Thethought=Trueflag is still set on reasoning/planning blocks exactly as before, and the/*FINAL_ANSWER*/boundary tag is also stripped from the split point so neither the reasoning block nor the final-answer block retains it.BuiltInPlanneralready delegates tag handling to the model's native thinking config and returnsNonefromprocess_planning_response, so no change is needed there.Two regression tests are added to
test_plan_re_act_planner.pycovering tag stripping for plain reasoning parts and for the/*FINAL_ANSWER*/split boundary.Fixes #3378