Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 65b4865

Browse files
committed
fix(lm-studio): merge native tool defaults in useSelectedModel
Similar to the LiteLLM fix in PR #10187, this ensures that the Tool Protocol dropdown appears in the UI for LM Studio users by merging supportsNativeTools and defaultToolProtocol from lMStudioDefaultModelInfo with the dynamically fetched model info.
1 parent ef31007 commit 65b4865

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
basetenModels,
3030
qwenCodeModels,
3131
litellmDefaultModelInfo,
32+
lMStudioDefaultModelInfo,
3233
BEDROCK_1M_CONTEXT_MODEL_IDS,
3334
isDynamicProvider,
3435
getProviderDefaultModelId,
@@ -300,10 +301,16 @@ function getSelectedModel({
300301
}
301302
case "lmstudio": {
302303
const id = apiConfiguration.lmStudioModelId ?? ""
303-
const info = lmStudioModels && lmStudioModels[apiConfiguration.lmStudioModelId!]
304+
const modelInfo = lmStudioModels && lmStudioModels[apiConfiguration.lmStudioModelId!]
305+
// Only merge native tool call defaults, not prices or other model-specific info
306+
const nativeToolDefaults = {
307+
supportsNativeTools: lMStudioDefaultModelInfo.supportsNativeTools,
308+
defaultToolProtocol: lMStudioDefaultModelInfo.defaultToolProtocol,
309+
}
310+
const info = modelInfo ? { ...nativeToolDefaults, ...modelInfo } : undefined
304311
return {
305312
id,
306-
info: info || undefined,
313+
info,
307314
}
308315
}
309316
case "deepinfra": {

0 commit comments

Comments
 (0)