feat(agents): stacked-PR notice in system_prompt_template #473

Merged
code-lead merged 1 commit from boss/464 into main 2026-04-27 17:10:54 +00:00
Collaborator

Append a ${if:parent_pr}…${endif} block to every per-type system_prompt_template so a stacked dispatch (#462) tells the agent its base branch is the parent PR — not main — and that an unexpected synchronized event is the rebase cascade, not a misroute. interpolatePromptTemplate gains the new conditional syntax; pruning runs before the regular ${var} pass so the unstacked path leaks no fragment.

Closes #464

Test plan

  • bun x turbo run typecheck clean (4 packages)
  • bun x @biomejs/biome@^2 check . / format . clean (only pre-existing infos in workdir.test.ts)
  • bun test — 2193 pass, 0 fail across the workspace
  • New tests cover: conditional-block syntax (set / unset / empty / multi-line / nested-vars), each shipped per-type template carrying the block + rendering both paths, and buildPrompt-level "stacked notice on / off" with the AC wording verbatim
Append a `${if:parent_pr}…${endif}` block to every per-type `system_prompt_template` so a stacked dispatch (#462) tells the agent its base branch is the parent PR — not `main` — and that an unexpected `synchronized` event is the rebase cascade, not a misroute. `interpolatePromptTemplate` gains the new conditional syntax; pruning runs before the regular `${var}` pass so the unstacked path leaks no fragment. Closes #464 ## Test plan - [x] `bun x turbo run typecheck` clean (4 packages) - [x] `bun x @biomejs/biome@^2 check .` / `format .` clean (only pre-existing infos in `workdir.test.ts`) - [x] `bun test` — 2193 pass, 0 fail across the workspace - [x] New tests cover: conditional-block syntax (set / unset / empty / multi-line / nested-vars), each shipped per-type template carrying the block + rendering both paths, and `buildPrompt`-level "stacked notice on / off" with the AC wording verbatim
feat(agents): stacked-PR notice in system_prompt_template
All checks were successful
qa / qa (pull_request) Successful in 9m11s
qa / dockerfile (pull_request) Successful in 13s
1cb60d6b81
Extend `interpolatePromptTemplate` with a `${if:NAME}…${endif}` conditional
block so the per-type templates can carry text that's only rendered when
the matching variable is set. Append the stacked-PR notice — "Your work
is stacked on PR #N. Your base branch is `pr/N`, not `main`. … your PR
will be automatically rebased — do not panic if you see an unexpected
`synchronized` event." — to every per-type `system_prompt_template` in
`config/agents.json` so a stacked dispatch (#462) reads the heads-up
before its task body, and an unstacked dispatch sees no fragment at all.

Closes #464

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
reviewer approved these changes 2026-04-27 17:10:29 +00:00
reviewer left a comment

Conditional interpolation logic, two-pass ordering, and all 6 per-type templates are correct. AC wording matches issue #464 verbatim. Tests cover set/unset paths, orphan-leak prevention, multi-block independence, and every shipped template via the live agents.json read. CI green.

Conditional interpolation logic, two-pass ordering, and all 6 per-type templates are correct. AC wording matches issue #464 verbatim. Tests cover set/unset paths, orphan-leak prevention, multi-block independence, and every shipped template via the live `agents.json` read. CI green.
code-lead deleted branch boss/464 2026-04-27 17:10:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!473
No description provided.