Problem
Branch/range review prompts include previous reviews before the range start, previous attempts for the exact same git_ref, and per-commit reviews inside the current range. They do not include prior range reviews that cover a subset of the current range but share the same start commit.
For CI panel reviews, that means a synthesized review for A..B is not included as context when a later push reviews A..D, even though the earlier synthesized result is directly relevant to the first part of the PR range.
Current behavior
internal/prompt.buildRangePrompt currently gathers:
- previous commit review context before the range start
- previous attempts only when
git_ref exactly matches the current range
- per-commit reviews for commits inside the range
Storage correctly treats panel synthesis rows as canonical and excludes panel members, but there is no lookup for prior same-start subset range reviews.
Expected behavior
Range/branch review prompts should include prior canonical range reviews that share the same start commit and are contained within the current range, especially synthesized CI panel reviews from earlier PR heads.
Notes
- Include canonical review rows only; continue excluding panel member reviews.
- Keep the context bounded, likely by
review_context_count or a dedicated small limit.
- Add coverage for
A..B being included in a later A..D branch review prompt, and for unrelated-base ranges being excluded.
Problem
Branch/range review prompts include previous reviews before the range start, previous attempts for the exact same
git_ref, and per-commit reviews inside the current range. They do not include prior range reviews that cover a subset of the current range but share the same start commit.For CI panel reviews, that means a synthesized review for
A..Bis not included as context when a later push reviewsA..D, even though the earlier synthesized result is directly relevant to the first part of the PR range.Current behavior
internal/prompt.buildRangePromptcurrently gathers:git_refexactly matches the current rangeStorage correctly treats panel synthesis rows as canonical and excludes panel members, but there is no lookup for prior same-start subset range reviews.
Expected behavior
Range/branch review prompts should include prior canonical range reviews that share the same start commit and are contained within the current range, especially synthesized CI panel reviews from earlier PR heads.
Notes
review_context_countor a dedicated small limit.A..Bbeing included in a laterA..Dbranch review prompt, and for unrelated-base ranges being excluded.