open-code-review/internal
Coldaine a53b16cff5
fix(agent): stop leaking {{plan_guidance}} into MAIN_TASK prompts (#33)
Replace the hard-coded Chinese-only empty-plan branch with a compiled
regex + helper that strips the "### Review Plan …" wrapper (any language
variant) when the plan phase produces no output.

TWO BUGS fixed:
- The wrapper was only stripped for the Chinese literal `### 审查计划`,
  not the actual English `### Review Plan (Optional)` shipped in the
  template, so `{{plan_guidance}}` leaked into the rendered prompt on
  every review where the plan phase was skipped or failed.
- The strip ran AFTER `ReplaceAll("{{plan_guidance}}", "")`, so the
  token was already gone and the regex couldn't match the wrapper.
  Fixed ordering: strip BEFORE replace.

Also simplifies the regex alternation per Copilot review feedback:
`Review Plan` and `审查计划` already subsume the `(Optional)`/`(可选)`
suffixes because the trailing `[^\n]*` consumes them.

Adds unit tests for English, Chinese, and integration (production flow).

Co-authored-by: Copilot <copilot-pull-request-reviewer@github.com>
2026-06-04 14:11:31 +08:00
..
agent fix(agent): stop leaking {{plan_guidance}} into MAIN_TASK prompts (#33) 2026-06-04 14:11:31 +08:00
config fix(config): update main_task template 2026-06-02 11:32:57 +08:00
diff style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
llm style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
model feat: init 2026-05-20 22:03:52 +08:00
release fix(build): improve Windows support based on PR #13 review feedback 2026-06-02 22:37:27 +08:00
session fix: handle Windows paths in session encodeRepoPath (#36) 2026-06-04 12:55:29 +08:00
stdout style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
suggestdiff feat: init 2026-05-20 22:03:52 +08:00
telemetry style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
tool style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
viewer style: apply go fmt formatting 2026-06-03 17:34:28 +08:00