Skip to content

Commit dfb1eed

Browse files
James Mtendamemacursoragent
andcommitted
fix(webview-ui): handle zoo-gateway in useSelectedModel switch so RouterName exhaustiveness holds
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7cdd52e commit dfb1eed

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

webview-ui/src/components/ui/hooks/useSelectedModel.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,15 @@ function getSelectedModel({
346346
const info = routerModels["vercel-ai-gateway"]?.[id]
347347
return { id, info }
348348
}
349+
case "zoo-gateway": {
350+
const id = getValidatedModelId(
351+
apiConfiguration.zooGatewayModelId,
352+
routerModels["zoo-gateway"],
353+
defaultModelId,
354+
)
355+
const info = routerModels["zoo-gateway"]?.[id]
356+
return { id, info }
357+
}
349358
// case "anthropic":
350359
// case "fake-ai":
351360
default: {

webview-ui/src/utils/__tests__/validate.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe("Model Validation Functions", () => {
4444
ollama: {},
4545
lmstudio: {},
4646
"vercel-ai-gateway": {},
47+
"zoo-gateway": {},
4748
poe: {},
4849
deepseek: {},
4950
}

0 commit comments

Comments
 (0)