@@ -23,7 +23,6 @@ import {
2323 type TerminalActionPromptType ,
2424 type HistoryItem ,
2525 type CloudUserInfo ,
26- type MarketplaceItem ,
2726 requestyDefaultModelId ,
2827 openRouterDefaultModelId ,
2928 glamaDefaultModelId ,
@@ -41,7 +40,7 @@ import { supportPrompt } from "../../shared/support-prompt"
4140import { GlobalFileNames } from "../../shared/globalFileNames"
4241import { ExtensionMessage , MarketplaceInstalledMetadata } from "../../shared/ExtensionMessage"
4342import { Mode , defaultModeSlug , getModeBySlug } from "../../shared/modes"
44- import { experimentDefault , experiments , EXPERIMENT_IDS } from "../../shared/experiments"
43+ import { experimentDefault } from "../../shared/experiments"
4544import { formatLanguage } from "../../shared/language"
4645import { DEFAULT_WRITE_DELAY_MS } from "@roo-code/types"
4746import { Terminal } from "../../integrations/terminal/Terminal"
@@ -71,7 +70,6 @@ import { WebviewMessage } from "../../shared/WebviewMessage"
7170import { EMBEDDING_MODEL_PROFILES } from "../../shared/embeddingModels"
7271import { ProfileValidator } from "../../shared/ProfileValidator"
7372import { getWorkspaceGitInfo } from "../../utils/git"
74- import { LmStudioHandler } from "../../api/providers"
7573import { forceFullModelDetailsLoad , hasLoadedFullDetails } from "../../api/providers/fetchers/lmstudio"
7674
7775/**
@@ -186,16 +184,22 @@ export class ClineProvider
186184 async performPreparationTasks ( cline : Task ) {
187185 // LMStudio: we need to force model loading in order to read its context size; we do it now since we're starting a task with that model selected
188186 if ( cline . apiConfiguration && cline . apiConfiguration . apiProvider === "lmstudio" ) {
189- if ( ! hasLoadedFullDetails ( cline . apiConfiguration . lmStudioModelId ! ) ) {
190- forceFullModelDetailsLoad (
191- cline . apiConfiguration . lmStudioBaseUrl ?? "http://localhost:1234" ,
192- cline . apiConfiguration . lmStudioModelId ! ,
193- )
194- }
187+ try {
188+ if ( ! hasLoadedFullDetails ( cline . apiConfiguration . lmStudioModelId ! ) ) {
189+ forceFullModelDetailsLoad (
190+ cline . apiConfiguration . lmStudioBaseUrl ?? "http://localhost:1234" ,
191+ cline . apiConfiguration . lmStudioModelId ! ,
192+ )
193+ }
195194 await forceFullModelDetailsLoad (
196195 cline . apiConfiguration . lmStudioBaseUrl ?? "http://localhost:1234" ,
197196 cline . apiConfiguration . lmStudioModelId ! ,
198197 )
198+ } catch ( error ) {
199+ this . log ( `Failed to load full model details for LM Studio: ${ error } ` )
200+ vscode . window . showErrorMessage ( error . message )
201+ }
202+ }
199203 }
200204
201205 // Removes and destroys the top Cline instance (the current finished task),
0 commit comments