Skip to content

Commit dc068a6

Browse files
fix: prevent duplicate statusline when user/project settings are the same file
When the CLI is launched from ~ (home directory), user-level and project-level settings.json resolve to the same file. This caused resolveSettingsSources to merge the same content twice, resulting in duplicate statusline segments and React non-unique key warnings. Fix: detect same-file early in resolveCurrentSettings and pass null for project settings when paths are identical.
1 parent 2f33293 commit dc068a6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/core/src/settings.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,12 @@ export function writeModelConfigSelection(
654654
}
655655

656656
export function resolveCurrentSettings(projectRoot: string = process.cwd()): ResolvedDeepcodingSettings {
657+
const userPath = path.resolve(getUserSettingsPath());
658+
const projectPath = path.resolve(getProjectSettingsPath(projectRoot));
659+
const sameFile = userPath === projectPath;
657660
return resolveSettingsSources(
658661
readSettings(),
659-
readProjectSettings(projectRoot),
662+
sameFile ? null : readProjectSettings(projectRoot),
660663
{
661664
model: DEFAULT_MODEL,
662665
baseURL: DEFAULT_BASE_URL,

0 commit comments

Comments
 (0)