Skip to content

Commit 7cf064c

Browse files
committed
fix: default defaultProvider to openai in config schema
configSchema required defaultProvider but had no .default(), so a config.json without the field was treated as invalid and backed up. Now falls back to "openai" at parse time.
1 parent 1d1a7dc commit 7cf064c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const providerConfigSchema = z.object({
3737
const configSchema = z.object({
3838
port: z.number().int().min(0).max(65535).default(10100),
3939
providers: z.record(z.string(), providerConfigSchema),
40-
defaultProvider: z.string().min(1),
40+
defaultProvider: z.string().min(1).default("openai"),
4141
}).passthrough().superRefine((config, ctx) => {
4242
if (Object.keys(config.providers).length > 0 && !(config.defaultProvider in config.providers)) {
4343
ctx.addIssue({

0 commit comments

Comments
 (0)