Skip to content

Commit 4856cfb

Browse files
bug: Deleted model file from imported models blocking model loading (#6317) (#6417)
1 parent 1989552 commit 4856cfb

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

web-app/src/services/providers/tauri.ts

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,31 @@ export class TauriProvidersService extends DefaultProvidersService {
7575
}) as ProviderSetting[],
7676
models: await Promise.all(
7777
models.map(
78-
async (model) =>
79-
({
78+
async (model) => {
79+
let capabilities: string[] = []
80+
81+
// Check for capabilities
82+
if ('capabilities' in model) {
83+
capabilities = model.capabilities as string[]
84+
} else {
85+
// Try to check tool support, but don't let failures block the model
86+
try {
87+
const toolSupported = await value.isToolSupported(model.id)
88+
if (toolSupported) {
89+
capabilities = [ModelCapabilities.TOOLS]
90+
}
91+
} catch (error) {
92+
console.warn(`Failed to check tool support for model ${model.id}:`, error)
93+
// Continue without tool capabilities if check fails
94+
}
95+
}
96+
97+
return {
8098
id: model.id,
8199
model: model.id,
82100
name: model.name,
83101
description: model.description,
84-
capabilities:
85-
'capabilities' in model
86-
? (model.capabilities as string[])
87-
: (await value.isToolSupported(model.id))
88-
? [ModelCapabilities.TOOLS]
89-
: [],
102+
capabilities,
90103
provider: providerName,
91104
settings: Object.values(modelSettings).reduce(
92105
(acc, setting) => {
@@ -105,7 +118,8 @@ export class TauriProvidersService extends DefaultProvidersService {
105118
},
106119
{} as Record<string, ProviderSetting>
107120
),
108-
}) as Model
121+
} as Model
122+
}
109123
)
110124
),
111125
}

0 commit comments

Comments
 (0)