Skip to content

Markdown Files in prompts Section are Misidentified as Rules and Dropped #12412

@Charlweed

Description

@Charlweed

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

  1. Create a prompt file at .continue/prompts/scotty.md.
  2. Add the following to your .continue/config.yaml:
    prompts:
      - uses: file://prompts/scotty.md
  3. Run the CLI with --verbose.
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationRelates to configuration optionskind:bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions