fix(cli): load rules into system message#10408
Open
uinstinct wants to merge 2 commits intocontinuedev:mainfrom
Open
fix(cli): load rules into system message#10408uinstinct wants to merge 2 commits intocontinuedev:mainfrom
uinstinct wants to merge 2 commits intocontinuedev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="extensions/cli/src/systemMessage.ts">
<violation number="1" location="extensions/cli/src/systemMessage.ts:249">
P2: Deduplication only checks against the initial Set and never records newly added markdown rules, so duplicates within markdownRules can still be appended to processedRules.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| const existingRulesSet = new Set(processedRules); | ||
| for (const rule of markdownRules) { | ||
| if (!existingRulesSet.has(rule.rule)) { | ||
| processedRules.push(rule.rule); |
Contributor
There was a problem hiding this comment.
P2: Deduplication only checks against the initial Set and never records newly added markdown rules, so duplicates within markdownRules can still be appended to processedRules.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At extensions/cli/src/systemMessage.ts, line 249:
<comment>Deduplication only checks against the initial Set and never records newly added markdown rules, so duplicates within markdownRules can still be appended to processedRules.</comment>
<file context>
@@ -165,6 +240,16 @@ export async function constructSystemMessage(
+ const existingRulesSet = new Set(processedRules);
+ for (const rule of markdownRules) {
+ if (!existingRulesSet.has(rule.rule)) {
+ processedRules.push(rule.rule);
+ }
+ }
</file context>
Suggested change
| processedRules.push(rule.rule); | |
| processedRules.push(rule.rule); | |
| existingRulesSet.add(rule.rule); |
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.
Description
Load markdown rules from ~/.continue/rules and current path's .continue/rules directories
resolves CON-5301
closes #9717
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Loads markdown rules from ~/.continue/rules and .continue/rules into the CLI system message and config so always-applied rules are included automatically. Aligns with Linear CON-5301 by applying global and repo rules without extra flags.
Written for commit 041541d. Summary will update on new commits.