-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Codebase/Colocated Rules Cache #6603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for continuedev failed. Why did it fail? →
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 1 issue across 8 files. Review it in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
await loadCodebaseRules(ide); | ||
newConfig.rules.unshift(...codebaseRules); | ||
errors.push(...codebaseRulesErrors); | ||
const codebaseRulesCache = CodebaseRulesCache.getInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doLoadConfig relies on the cache being populated, but it never calls await codebaseRulesCache.refresh(ide)
(or checks that it has already run). If this function executes before another component refreshes the cache, codebaseRulesCache.rules
and errors
will both be empty, silently dropping colocated rules from the loaded config.
Description
A major source of slow config loading is walk dir to find colocated rules.md files. This PR adds a codebase/colocated rules cache that initializes on startup and then updates and triggers a config reload when a rules.md file is edited. This way it's not doing a full walk dir for any config reload.
Summary by cubic
Added a cache for codebase colocated rules.md files to speed up config loading. The cache initializes on startup and updates when a rules.md file is edited, avoiding full directory scans on each config reload.