fix(prompts): SYSTEM.md content silently dropped in default sessions#1264
Open
mrosnerr wants to merge 1 commit into
Open
fix(prompts): SYSTEM.md content silently dropped in default sessions#1264mrosnerr wants to merge 1 commit into
mrosnerr wants to merge 1 commit into
Conversation
SYSTEM.md content was loaded by loadSystemPromptFiles() and passed to the
template data, but the default system-prompt.md template never referenced
`{{systemPromptCustomization}}`. Only custom-system-prompt.md rendered it,
and that template is only active when customPrompt is explicitly provided
(which sdk.ts never does).
This meant all SYSTEM.md content — orchestration protocol, delegation
triggers, harness bindings — was silently dropped in every session.
Add the same `{{#if systemPromptCustomization}}` block to the default
template, positioned after the [ENV] section and before Skills/Rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add the
{{#if systemPromptCustomization}}Handlebars block to the defaultsystem-prompt.mdtemplate so thatSYSTEM.mdcontent discovered by the capability system is actually rendered into the prompt.Why
SYSTEM.mdfiles discovered by capability providers (.agents/SYSTEM.md,.claude/SYSTEM.md,.gemini/system.md, etc.) are loaded byloadSystemPromptFiles(), deduped, and passed asdata.systemPromptCustomizationto the Handlebars template — but the defaultsystem-prompt.mdtemplate never references the variable. The content is prepared correctly and then silently discarded.The previous version of the template (before the rewrite in
7b17024, Feb 24) did render it:The rewrite dropped this block. Only
custom-system-prompt.mdstill renders it, but that template is only active whencustomPromptis explicitly provided — which the default SDK path never does.The block is placed after the internal URLs section and before Skills, matching the position of the old template's
<context>block.Testing
bun run check:ts— all workspaces pass (exit 0, no errors).custom-system-prompt.md..mdtemplate file with no logic.bun checkpasses