fix(shared): fix optional chaining on modelItem

Change modelItem.id to modelItem?.id to handle null values

Prevents TypeError when modelItem is null in provider-models cache

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-23 02:42:43 +09:00
parent 6af5dca1b5
commit 2168770bec
+1 -1
View File
@@ -199,7 +199,7 @@ export async function fetchAvailableModels(
// Handle both string[] (legacy) and object[] (with metadata) formats
const modelId = typeof modelItem === 'string'
? modelItem
: (modelItem as any)?.id
: modelItem?.id
if (modelId) {
modelSet.add(`${providerId}/${modelId}`)