From 0dc5f56af40240325809629343c31226b8612dcf Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 23 Feb 2026 02:42:43 +0900 Subject: [PATCH] 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 --- src/shared/model-availability.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/model-availability.ts b/src/shared/model-availability.ts index 8a23f5b0..7537d2d0 100644 --- a/src/shared/model-availability.ts +++ b/src/shared/model-availability.ts @@ -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}`)