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 cd6c9cb5dc
commit 0dc5f56af4

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}`)