Skip to content

Commit fd98c31

Browse files
committed
config: improve config schema
1 parent 1278353 commit fd98c31

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

packages/opencode/src/config/config.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,18 @@ export namespace Config {
169169
.describe("Modes configuration, see https://opencode.ai/docs/modes"),
170170
provider: z
171171
.record(
172-
ModelsDev.Provider.partial().extend({
173-
models: z.record(ModelsDev.Model.partial()),
174-
options: z.record(z.any()).optional(),
175-
}),
172+
ModelsDev.Provider.partial()
173+
.extend({
174+
models: z.record(ModelsDev.Model.partial()),
175+
options: z
176+
.object({
177+
apiKey: z.string().optional(),
178+
baseURL: z.string().optional(),
179+
})
180+
.catchall(z.any())
181+
.optional(),
182+
})
183+
.strict(),
176184
)
177185
.optional()
178186
.describe("Custom provider configurations and model overrides"),

0 commit comments

Comments
 (0)