diff options
| author | Tommy D. Rossi <[email protected]> | 2026-02-07 00:46:31 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-06 17:46:31 -0600 |
| commit | 576a681a4facafc42159dd1044b4abb40546bfdf (patch) | |
| tree | 546e964888be6795f83ba0422394962fc08ba8dc /packages | |
| parent | 95d2d4d3a77adceacdee28529d554dac9d2564b0 (diff) | |
| download | opencode-576a681a4facafc42159dd1044b4abb40546bfdf.tar.gz opencode-576a681a4facafc42159dd1044b4abb40546bfdf.zip | |
feat: add models.dev schema ref for model autocomplete in opencode.json (#12528)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/config/config.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 6dd0592d5..e01fee28a 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -33,6 +33,8 @@ import { proxied } from "@/util/proxied" import { iife } from "@/util/iife" export namespace Config { + const ModelId = z.string().meta({ $ref: "https://models.dev/model-schema.json#/$defs/Model" }) + const log = Log.create({ service: "config" }) // Managed settings directory for enterprise deployments (highest priority, admin-controlled) @@ -653,7 +655,7 @@ export namespace Config { template: z.string(), description: z.string().optional(), agent: z.string().optional(), - model: z.string().optional(), + model: ModelId.optional(), subtask: z.boolean().optional(), }) export type Command = z.infer<typeof Command> @@ -669,7 +671,7 @@ export namespace Config { export const Agent = z .object({ - model: z.string().optional(), + model: ModelId.optional(), variant: z .string() .optional() @@ -1040,11 +1042,8 @@ export namespace Config { .array(z.string()) .optional() .describe("When set, ONLY these providers will be enabled. All other providers will be ignored"), - model: z.string().describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(), - small_model: z - .string() - .describe("Small model to use for tasks like title generation in the format of provider/model") - .optional(), + model: ModelId.describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(), + small_model: ModelId.describe("Small model to use for tasks like title generation in the format of provider/model").optional(), default_agent: z .string() .optional() |
