SC-4 System prompt template swap (resolveSystemPrompt at dispatch) #626
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#626
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
User story
As a platform engineer, I want the dispatch path to read the system prompt template through
resolveSystemPrompt(agent)instead of the in-memoryagents.json::types[].system_prompt_templateobject, so that operator edits at any scope (global / agent_type / instance) take effect on the next dispatch without a service restart.Acceptance criteria
Source-of-truth swap
types[t].system_prompt_templateandtypes[t].default_system_promptin the dispatch path (likelyapps/server/src/domain/agent/agent-runner.tsand any helper underapps/server/src/domain/dispatch/that builds the agent's first turn) withresolveSystemPrompt(agent).${repo},${issue_number},${if:parent_pr}…${endif}interpolation logic is unchanged. Only the source of the template moves fromagents.json(in-memory config object) to the resolver.default_system_promptandsystem_prompt_templateinagents.jsonbecome builtin-only inputs —builtin-syncreads them and writes onesystem_promptrow per type (scope = 'builtin',agent_type = <type>).Render-to-disk integration
agent-env-sync.renderForInstance(SC-2) writes<env-dir>/system-prompt.mdfromresolveSystemPrompt(agent)so the per-instance file mirrors the resolved template. The dispatch path may read this file instead of calling the resolver directly — pick one path and document it in the handler docstring.Tests
instance-scopesystem_promptrow produces a different prompt than the agent-type sibling on the same dispatch.scope = 'builtin'; an existingagent_typeoverride is preserved.Out of scope
References
specs/agent-config-customization.md§Story SC-4apps/server/src/domain/agent/agent-runner.ts— first-turn constructionapps/server/src/shared/config/agents-config-schema.ts—system_prompt_template/default_system_promptfield definitions