fix(orchestrator): deduplicate '## Plan' heading in PR body#6
Open
Maxtanh-Meta wants to merge 1 commit into
Open
fix(orchestrator): deduplicate '## Plan' heading in PR body#6Maxtanh-Meta wants to merge 1 commit into
Maxtanh-Meta wants to merge 1 commit into
Conversation
buildPRBody unconditionally prepended '## Plan' before job.PlanText, but the planning agent often includes its own '## Plan' heading in the markdown output. This resulted in duplicate headings in PR descriptions. Now checks if PlanText already starts with '## Plan' before adding one.
Author
Code Review (via Codex)Overall: Approve with minor suggestion Main Concern
Suggested fix: tighten the check to an exact heading boundary: if !strings.HasPrefix(planText, "## Plan\n") && planText != "## Plan" {
b.WriteString("## Plan\n\n")
}Additional Notes
VerdictThe fix is correct for the common case and the tests cover the main regression well. Just needs the prefix match tightened. 👍 |
Maxtanh-Meta
added a commit
to Maxtanh-Meta/symphony-go
that referenced
this pull request
May 19, 2026
fix(orchestrator): use worktree repo path for plan reviewer
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.
Problem
buildPRBodyunconditionally prepends a## Planheading before insertingjob.PlanText. However, the planning agent's output often already starts with its own## Planheading (since the prompt says "any structure you like"). This produces PR descriptions with a duplicate## Planheading — the first one containing all the plan content, and the second one empty right before## Validation.Example: https://github.com/Maxtanh-Meta/one-minute-games/pull/39
Fix
Check if
PlanTextalready starts with## Planbefore adding one. If the agent included the heading, we skip ours; if not, we add it as before.Test
Added
TestBuildPRBodyNoDuplicatePlanHeadingcovering both cases (agent includes heading vs. doesn't).