Before submitting your bug report
Relevant environment info
- OS:Windows
- Continue version: 1.52
- IDE version:
- Model:
- config:
prompts:
- uses: file://prompts/scotty.md
OR link to agent in Continue hub:
Description
Description
When using a file:// URI or slug to load a markdown file within the prompts section of config.yaml, the content is correctly read but fails to be applied to the final configuration. The unrolling logic incorrectly assumes all markdown files are "Rules" and wraps them in a rules array, causing the prompt processor to find an empty prompts section and silently discard the content.
Root Cause Analysis
The failure occurs in @continuedev/config-yaml/src/load/unroll.ts within the parseYamlOrMarkdownRule function.
When resolveBlock is called for a prompt, it historically assumed all markdown files were rules. Because the file was markdown, it was wrapped in { rules: [...] }. However, the calling loop in unrollBlocks expects the resulting object to have a prompts key:
const blockConfigYaml = await resolveBlock(
blockIdentifier,
unrolledBlock.with,
registry,
);
const block = blockConfigYaml[section]?.[0]; // section is "prompts"
Since blockConfigYaml["prompts"] was undefined (as it was in rules instead), the item was dropped.
Log Evidence (Verified with --verbose)
[debug]: unrollBlocks: Processing section "prompts" with 1 items
[debug]: unrollBlocks: Resolving "uses" block: "file://prompts/scotty.md"
[debug]: RegistryClient: Getting content from file: prompts/scotty.md
[debug]: RegistryClient: Successfully read 214 bytes
[debug]: unrollBlocks: WARNING - Section "prompts" not found in resolved block config
Proposed Fix (Now Implemented)
Update parseYamlOrMarkdownContent (renamed from parseYamlOrMarkdownRule) and its callers to accept the target section name as a sectionHint. If the target section is prompts, the markdown is now correctly parsed and wrapped in a prompts array.
To reproduce
- Create a prompt file at
.continue/prompts/scotty.md.
- Add the following to your
.continue/config.yaml:
prompts:
- uses: file://prompts/scotty.md
- Run the CLI with
--verbose.
- Observe the logs or check the final configuration; the prompt from
scotty.md will be missing
Log output
REQUIRES ENHANCED LOGGING INCLUDED IN THE PROPOSED FIX
[debug]: unrollBlocks: Processing section "prompts" with 1 items
[debug]: unrollBlocks: Resolving "uses" block: "file://prompts/scotty.md"
[debug]: RegistryClient: Getting content from file: prompts/scotty.md
[debug]: RegistryClient: Successfully read 214 bytes
[debug]: unrollBlocks: WARNING - Section "prompts" not found in resolved block config
Before submitting your bug report
Relevant environment info
Description
Description
When using a
file://URI or slug to load a markdown file within thepromptssection ofconfig.yaml, the content is correctly read but fails to be applied to the final configuration. The unrolling logic incorrectly assumes all markdown files are "Rules" and wraps them in arulesarray, causing the prompt processor to find an emptypromptssection and silently discard the content.Root Cause Analysis
The failure occurs in
@continuedev/config-yaml/src/load/unroll.tswithin theparseYamlOrMarkdownRulefunction.When
resolveBlockis called for a prompt, it historically assumed all markdown files were rules. Because the file was markdown, it was wrapped in{ rules: [...] }. However, the calling loop inunrollBlocksexpects the resulting object to have apromptskey:Since
blockConfigYaml["prompts"]was undefined (as it was inrulesinstead), the item was dropped.Log Evidence (Verified with --verbose)
Proposed Fix (Now Implemented)
Update
parseYamlOrMarkdownContent(renamed fromparseYamlOrMarkdownRule) and its callers to accept the target section name as asectionHint. If the target section isprompts, the markdown is now correctly parsed and wrapped in apromptsarray.To reproduce
.continue/prompts/scotty.md..continue/config.yaml:--verbose.scotty.mdwill be missingLog output