You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prompt construction in internal/prompt had accumulated too much behavior in Go-side string assembly, which made the actual prompt structure hard to reason about, easy to regress during cleanup, and split across multiple sources of truth. This refactor moves the prompt format itself into templates so the rendered prompt shape is defined where it is authored, while preserving existing review behavior and fixing the regressions uncovered during the migration and subsequent roborev reviews.
Summary
make prompt construction template-driven end to end by moving assembled prompt bodies, prompt sections, and agent-specific system prompts onto embedded .md.gotmpl templates backed by typed view data
preserve existing prompt behavior while fixing cleanup regressions in dirty and range prompt fitting, including truncated diff fallbacks, optional-context retention, and fallback selection quality
resolve the accumulated roborev findings on gotmpl so the branch ends with no open review jobs
Verdict: No medium-or-higher issues found across the submitted reviews.
The reviewed changes appear clean. Both substantive review outputs reported no issues, and the security review explicitly found no externally exploitable concerns in the modified paths under this repo’s local-only trust model.
Summary verdict: Changes are mostly sound, but there is one medium-severity regression in range prompt trimming that should be fixed before merge.
Medium
internal/prompt/prompt_body_templates.go:287 trimOptionalSections no longer considers InRangeReviews, even though buildRangePrompt now stores per-commit reviews in optional.InRangeReviews. When a range prompt exceeds budget, the fitter can now strip subjects and current range entries before dropping this optional context, which regresses prior behavior where the optional block was trimmed first.
Fix: include InRangeReviews in trimOptionalSections, trim it before mutating Current range metadata, and add a regression test for oversized range prompts with populated per-commit reviews.
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
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.
Why
Prompt construction in
internal/prompthad accumulated too much behavior in Go-side string assembly, which made the actual prompt structure hard to reason about, easy to regress during cleanup, and split across multiple sources of truth. This refactor moves the prompt format itself into templates so the rendered prompt shape is defined where it is authored, while preserving existing review behavior and fixing the regressions uncovered during the migration and subsequentroborevreviews.Summary
.md.gotmpltemplates backed by typed view dataroborevfindings ongotmplso the branch ends with no open review jobsTest Plan