File tree Expand file tree Collapse file tree
packages/opencode-plugin-mimic/src/modules/observation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -280,10 +280,11 @@ async function analyzePatternsWithLLM(
280280 }
281281
282282 const observerConfig = "observer" in config ? config . observer : undefined ;
283- const modelId = observerConfig ?. model || DEFAULT_OBSERVER_MODEL ;
284- // Extract provider from model ID (e.g., "anthropic/claude-3-haiku" -> "anthropic")
285- // If model doesn't contain "/", split returns the original string, so validate it
286- const extractedProvider = modelId . includes ( "/" ) ? modelId . split ( "/" ) [ 0 ] : undefined ;
283+ const rawModelId = observerConfig ?. model || DEFAULT_OBSERVER_MODEL ;
284+ // Extract provider and model from model ID (e.g., "anthropic/claude-3-haiku" -> provider: "anthropic", model: "claude-3-haiku")
285+ const hasSlash = rawModelId . includes ( "/" ) ;
286+ const extractedProvider = hasSlash ? rawModelId . split ( "/" ) [ 0 ] : undefined ;
287+ const modelId = hasSlash ? rawModelId . split ( "/" ) . slice ( 1 ) . join ( "/" ) : rawModelId ;
287288 const providerId = observerConfig ?. provider || extractedProvider || DEFAULT_OBSERVER_PROVIDER ;
288289
289290 try {
You can’t perform that action at this time.
0 commit comments