Files
orca/tests
Jinjing d185bf4bef fix(source-control-ai): carry the generated PR body in a sentinel envelope
The PR-details prompt asked the model to return a multi-hundred-line markdown
body as a single JSON string literal. One unescaped double quote in the prose
("something went wrong") made JSON.parse throw, and the bare catch in
generatePullRequestFields turned a ~99%-correct run into "Generated pull
request details could not be parsed." with nothing kept.

- Ask for a marker envelope instead: <<<ORCA_PR_FIELDS>>> with single-line
  base/title/draft, then <<<ORCA_PR_BODY>>>, the raw markdown, and
  <<<ORCA_PR_END>>>. The body is a byte-intact slice, never a string literal,
  so quotes, backticks, fences and headings have no escaping surface.
- Keep the legacy JSON reply (plain, fenced and prose-wrapped) as a fallback
  for custom command templates and models that ignore the new instruction;
  assertJsonTextStructureWithinLimits still guards that path.
- Capture the raw reply as failureOutput on parse failure, the way
  generateBranchName does, instead of discarding the run.
- Resolve two contradictory prompt rules: the current description wins on
  structure (write Problem/Solution content into an equivalent existing
  section rather than adding a second heading), and an unfilled `Fixes #`
  stub is left exactly as it stands when no issue is linked.
2026-09-14 14:47:53 -07:00
..