Failure to parse "rules" block with custom config and using CLI
Before submitting your bug report
- [x] I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- [x] I'm not able to find a related conversation on GitHub discussions that reports the same bug
- [x] I'm not able to find an open issue that reports the same bug
- [x] I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: arch linux (and Ubuntu)
- Continue version: 1.5.26
- IDE version: CLI
- Model: N/A
- config:
name: Rules
version: 1.0.0
schema: v1
rules:
- "simple string rule"
Description
I am attempting to do a CLI test via:
echo test | cn -p --readonly --config ~/continue.yaml --model fake
and the parser continually breaks (adding invisible rules I suppose?) with this error:
❯ echo test | cn -p --readonly --config ~/continue.yaml --model fake
{"status":"error","message":"Failed to parse config: rules.1: Invalid input"}
Which doesn't make sense, as I don't have a "1" rule, as it seems to count from 0 (it is always 1 higher than my total rule count - if I have 3 rules, it will complain about rules.3).
This sample config is a minimal reproduction, with model blocks removed for privacy (local ollama on an internal IP was in the original, but is irrelevant here).
If I include the --rule flag it "works" (as in, it doesn't show this error), however I never get a response back from the remote.
If someone could help guide me into the cn equivalent of a single read only interaction via the CLI (using a non-default model option), that would be appreciated - I would expect it to print a response to my echo input (and I would define, in the models block, my apiBase:
To reproduce
See description
Log output
See description
Related Issues
Found several related issues:
Rules parsing:
- #8885 - Some rules are treated as prompts
- #6076 - Incorrect docs for rules and prompts
CLI-specific issues:
- #7327 - [Continue CLI] Fatal error: Cannot read properties of undefined (reading 'startsWith')
- #7658 - Ollama apiBase endpoint differs from VSCode to "cn"
- #8643 - Tool calling no longer works in the CLI
Config parsing:
- #6339 - Failed to parse config (workspace path in WSL2)
I think you will need to have a uses: <link-to-rule-md-file> or hub-block
It is better to have rule.md file as they are automatically picked up when in the codebase or inside ~/.continue folder
more on this here: https://docs.continue.dev/customize/deep-dives/rules
Also you get the parsing error because the parser expects a uses syntax inside rules block.