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:
parent
cd6c9cb5dc
commit
0dc5f56af4
@ -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}`)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user