Skip to content

Strip internal planning tags from PlanReActPlanner output content blocks - #6709

Closed
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3378-1938
Closed

Strip internal planning tags from PlanReActPlanner output content blocks#6709
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3378-1938

Conversation

@guptaishaan

Copy link
Copy Markdown
Contributor

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.

This PR adds a _strip_leading_planning_tag helper that removes the leading marker from each text block before it is emitted, so consumers receive clean content blocks. The thought=True flag 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.

BuiltInPlanner already delegates tag handling to the model's native thinking config and returns None from process_planning_response, so no change is needed there.

Two regression tests are added to test_plan_re_act_planner.py covering tag stripping for plain reasoning parts and for the /*FINAL_ANSWER*/ split boundary.

Fixes #3378

`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>
@adk-bot adk-bot added the core [Component] This issue is related to the core interface and implementation label Aug 13, 2026
copybara-service Bot pushed a commit that referenced this pull request Aug 20, 2026
@adk-bot

adk-bot commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Thank you @guptaishaan for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit ac8dad2.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot added the merged [Status] This PR is merged label Aug 20, 2026
@adk-bot adk-bot closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core [Component] This issue is related to the core interface and implementation merged [Status] This PR is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standarlize content block for PlanReActPlanner and BuiltInPlanner

3 participants