From 66b0838b3d3d42c6ca9923b631f5364b3460e646 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 9 Sep 2025 18:21:45 -0700 Subject: [PATCH 1/2] fix: z.string fallback for model capability --- .vscode/settings.json | 3 ++- packages/config-yaml/src/schemas/models.ts | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c55d9798c..9f3f17f98 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -43,7 +43,8 @@ "extensions/vscode/e2e/storage": true, "extensions/vscode/e2e/vsix": true, "extensions/.continue-debug": true, - "extensions/cli/dist/**": true + "extensions/cli/dist/**": true, + "packages/config-yaml/dist/**": true // "sync/**": true }, "editor.formatOnSave": true, diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index d5af3bfaa..1f758fa5b 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -37,8 +37,12 @@ export const modelCapabilitySchema = z.union([ z.literal("tool_use"), z.literal("image_input"), z.literal("next_edit"), + z.string(), ]); -export type ModelCapability = z.infer; + +// not ideal but lose type suggestions if use z.infer because of the string fallback + +export type ModelCapability = "tool_use" | "image_input" | "next_edit"; export const completionOptionsSchema = z.object({ contextLength: z.number().optional(), From f31ddccab5385c17bd2ba45c392ea4e2a0cf375f Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Tue, 9 Sep 2025 18:23:11 -0700 Subject: [PATCH 2/2] chore: pr comment --- packages/config-yaml/src/schemas/models.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 1f758fa5b..0b9b8202d 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -37,11 +37,10 @@ export const modelCapabilitySchema = z.union([ z.literal("tool_use"), z.literal("image_input"), z.literal("next_edit"), - z.string(), + z.string(), // Needed for forwards compatibility, see https://github.com/continuedev/continue/pull/7676 ]); // not ideal but lose type suggestions if use z.infer because of the string fallback - export type ModelCapability = "tool_use" | "image_input" | "next_edit"; export const completionOptionsSchema = z.object({