feat(agents): per-type system_prompt_template in agents.json #469
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!469
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/451"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
types.<type>.system_prompt_templatetoagents.jsonso each role can carry its own framing — interpolated at dispatch time with${repo},${issue_number},${forgejo_url},${agent_name},${agent_type},${pr_number}(when PR-scoped),${parent_pr}(when set); unknown placeholders render literally; types that omit the template fall back to the legacy hardcoded preamble. Default templates ship for all six types and reproduce current prompt text verbatim.Closes #451
Test plan
bun x turbo run typecheckcleanbun x @biomejs/biome@^2 check .clean (only pre-existing infos inworkdir.test.ts)bun x turbo run test— 2160 pass, 0 fail (with clean env)pr_numberheuristic,parent_pr, Penpot interaction, andtask.system_promptignore-when-template-set)Operators can now set `types.<type>.system_prompt_template` in `config/agents.json` to replace the hardcoded prompt preamble with a role-specific framing — interpolated with `${repo}`, `${issue_number}`, `${forgejo_url}`, `${agent_name}`, `${agent_type}`, `${pr_number}` (when PR-scoped) and `${parent_pr}` (when set). Unknown placeholders render literally; types that omit the template fall back to the legacy preamble path. Default templates ship for all six types and reproduce the current prompt text verbatim. Closes #451 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Template interpolation, fallback logic, and config propagation are all correct. Tests are thorough and CI is green.
Nit (non-blocking):
vars.forgejo_urlis wired to the module-levelFORGEJO_URLconstant rather than the configurableforgejoHostUrlset bysetMcpConfig— but the legacy preamble path does the same (line 199), so this is consistent pre-existing behaviour, not a regression.