fix: use config.yaml name for default Local Config profile#11110
fix: use config.yaml name for default Local Config profile#11110MumuTW wants to merge 5 commits intocontinuedev:mainfrom
Conversation
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="core/config/profile/LocalProfileLoader.ts">
<violation number="1" location="core/config/profile/LocalProfileLoader.ts:46">
P2: Falsy check on override content causes empty override files to fall back to global config and potentially assign the wrong profile title.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
The configYamlSchema requires both name and version fields. The test only provided name, causing parseConfigYaml to reject the config and falling back to the default "Local Config" title. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
An empty override file should not fall back to global config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ac7cc66 to
9d0b59a
Compare
|
Rebased onto latest |
…oadConfig mock The module-level afterEach with vi.restoreAllMocks() was running after every test, including those in the first describe block. This reset the mockDoLoadConfig spy, causing the second test to receive undefined from doLoadConfig and fail with "Cannot read properties of undefined (reading 'errors')".
There was a problem hiding this comment.
@MumuTW this would be a great improvement. I think the config file is already loaded and parsed in doLoadConfig, and the name is available in configYamlResult but lost since ConfigResult doesn't have a name/title.
Could this be fixed by just somehow just passing it back up as an optional name in ConfigResult or similar? Bit funky to follow the logic with RegistryClient but I think adding optional name to that or to ContinueConfig could be fine
The main problem is I think this current approach would fail every call for various environments like WSL, so even though it's in a try/catch I'd like to avoid the duplicate read and have it work for those envs as well
Summary
~/.continue/config.yamlwhen loading the global local profileLocal Configfallback when the file is missing, unreadable, or unparseableLocalProfileLoaderregression test covering custom name plus fallback casesTesting
npm run -s vitest -- config/profile/LocalProfileLoader.vitest.ts(fails in this workspace due unresolved local package entry for@continuedev/config-yaml)Continue Tasks: 🔄 7 running — View all
Summary by cubic
Use the name from ~/.continue/config.yaml as the default Local Config profile title. Falls back to "Local Config" when the file is missing, unreadable, malformed, or the name is blank; empty override files no longer trigger a fallback.
afterEachto avoid resettingdoLoadConfigmocks.Written for commit c761871. Summary will update on new commits.