fix: apply Zod defaults to empty config fallback

This commit is contained in:
MoerAI
2026-03-27 21:30:56 +09:00
parent 5b9b6eb0b8
commit 2b2b280895

View File

@@ -188,9 +188,9 @@ export function loadPluginConfig(
migrateLegacyConfigFile(projectDetected.path);
}
// Load user config first (base)
// Load user config first (base). Parse empty config through Zod to apply field defaults.
let config: OhMyOpenCodeConfig =
loadConfigFromPath(userConfigPath, ctx) ?? {};
loadConfigFromPath(userConfigPath, ctx) ?? OhMyOpenCodeConfigSchema.parse({});
// Override with project config
const projectConfig = loadConfigFromPath(projectConfigPath, ctx);