Skip to content

fix: use config.yaml name for default Local Config profile#11110

Open
MumuTW wants to merge 4 commits intocontinuedev:mainfrom
MumuTW:fix-local-config-name-11061
Open

fix: use config.yaml name for default Local Config profile#11110
MumuTW wants to merge 4 commits intocontinuedev:mainfrom
MumuTW:fix-local-config-name-11061

Conversation

@MumuTW
Copy link
Contributor

@MumuTW MumuTW commented Mar 6, 2026

Summary

  • read the default profile title from ~/.continue/config.yaml when loading the global local profile
  • keep the existing Local Config fallback when the file is missing, unreadable, or unparseable
  • add a focused LocalProfileLoader regression test covering custom name plus fallback cases

Testing

  • 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.

  • Bug Fixes
    • Read title from the global config; fallback to "Local Config" if invalid. Tests include the required version field, cover name/fallback cases, and scope afterEach to avoid resetting doLoadConfig mocks.
    • Use a strict undefined check for override content so empty override files don’t trigger a global fallback.

Written for commit 3b8ac55. Summary will update on new commits.

@MumuTW MumuTW requested a review from a team as a code owner March 6, 2026 05:45
@MumuTW MumuTW requested review from Patrick-Erichsen and removed request for a team March 6, 2026 05:45
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 6, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

MumuTW and others added 3 commits March 18, 2026 04:16
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>
@MumuTW MumuTW force-pushed the fix-local-config-name-11061 branch from ac7cc66 to 9d0b59a Compare March 18, 2026 04:17
@MumuTW
Copy link
Contributor Author

MumuTW commented Mar 18, 2026

Rebased onto latest main to resolve merge conflicts in LocalProfileLoader.vitest.ts. The conflict was between the newly added override-file tests on main and this PR's config.yaml name tests — resolved by keeping both test suites in separate describe blocks. All 3 original commits preserved.

…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')".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant