From 6f3921f7641fdf1af8ea85489a4d606b997d37a7 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 23 Jul 2025 16:32:21 +0000 Subject: [PATCH] fix: add HuggingFace case to useSelectedModel hook --- webview-ui/src/components/ui/hooks/useSelectedModel.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/ui/hooks/useSelectedModel.ts b/webview-ui/src/components/ui/hooks/useSelectedModel.ts index 928ebb42f4..b788bc5769 100644 --- a/webview-ui/src/components/ui/hooks/useSelectedModel.ts +++ b/webview-ui/src/components/ui/hooks/useSelectedModel.ts @@ -34,6 +34,8 @@ import { litellmDefaultModelId, claudeCodeDefaultModelId, claudeCodeModels, + huggingFaceDefaultModelId, + huggingFaceModels, } from "@roo-code/types" import type { RouterModels } from "@roo/api" @@ -214,11 +216,16 @@ function getSelectedModel({ const info = claudeCodeModels[id as keyof typeof claudeCodeModels] return { id, info: { ...openAiModelInfoSaneDefaults, ...info } } } + case "huggingface": { + const id = apiConfiguration.huggingFaceModelId ?? huggingFaceDefaultModelId + const info = huggingFaceModels[id as keyof typeof huggingFaceModels] + return { id, info: info || openAiModelInfoSaneDefaults } + } // case "anthropic": // case "human-relay": // case "fake-ai": default: { - provider satisfies "anthropic" | "gemini-cli" | "human-relay" | "fake-ai" + provider satisfies "anthropic" | "gemini-cli" | "human-relay" | "fake-ai" | "huggingface" const id = apiConfiguration.apiModelId ?? anthropicDefaultModelId const info = anthropicModels[id as keyof typeof anthropicModels] return { id, info }