Skip to content

Strip structural tags from PlanReActPlanner response parts - #6655

Open
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3378-6945
Open

Strip structural tags from PlanReActPlanner response parts#6655
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3378-6945

Conversation

@guptaishaan

Copy link
Copy Markdown
Contributor

PlanReActPlanner.process_planning_response was leaving raw structural markers
(/*PLANNING*/, /*REASONING*/, /*ACTION*/, /*REPLANNING*/,
/*FINAL_ANSWER*/) in the text of the returned types.Part objects.
Consumers had to parse those markers themselves to distinguish reasoning from
the final answer, which is exactly the fragile hand-rolling that standardized
content blocks are meant to avoid.

This change strips the leading structural tag from each text part before it is
returned. The part.thought = True flag already serves as the
machine-readable indicator that a part contains reasoning rather than a
user-visible answer, so no new fields are needed. The /*FINAL_ANSWER*/
separator is also stripped from the reasoning text when a single part contains
both sections.

Two regression tests are added to test_plan_re_act_planner.py to verify that
no tag appears in the text of any returned part.

Fixes #3378

`PlanReActPlanner.process_planning_response` was leaving raw structural markers

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 9, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standarlize content block for PlanReActPlanner and BuiltInPlanner

3 participants