Skip to content

Commit 190d79c

Browse files
committed
fix: add modelId to modelsWithLoadedDetails Set after force loading
This fixes a race condition where forceFullModelDetailsLoad would load model details but not mark them as loaded, causing hasLoadedFullDetails to always return false and models to be unnecessarily reloaded on every task start. The fix ensures that once a model's full details are loaded, it's properly tracked in the Set to prevent redundant loading operations.
1 parent eb28c86 commit 190d79c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/api/providers/fetchers/lmstudio.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export const forceFullModelDetailsLoad = async (baseUrl: string, modelId: string
2020
await client.llm.model(modelId)
2121
await flushModels("lmstudio")
2222
await getModels({ provider: "lmstudio" }) // force cache update now
23+
24+
// Mark this model as having full details loaded
25+
modelsWithLoadedDetails.add(modelId)
2326
} catch (error) {
2427
if (error.code === "ECONNREFUSED") {
2528
console.warn(`Error connecting to LMStudio at ${baseUrl}`)

0 commit comments

Comments
 (0)