(model: string | undefined)
| 116 | * (assume capable) — see the policy note above. |
| 117 | */ |
| 118 | export function isReasoningModel(model: string | undefined): boolean { |
| 119 | if (!model) return true; |
| 120 | |
| 121 | const normalized = normalizeModelName(model)?.toLowerCase() ?? ""; |
| 122 | const id = stripProviderPrefix(normalized); |
| 123 | |
| 124 | // Env overrides win, parsed fresh so they remain test-stubbable. |
| 125 | const envNon = parseEnvList(process.env.AIMOCK_NONREASONING_MODELS); |
| 126 | if (matchesAny(id, envNon)) return false; |
| 127 | const envReasoning = parseEnvList(process.env.AIMOCK_REASONING_MODELS); |
| 128 | if (matchesAny(id, envReasoning)) return true; |
| 129 | |
| 130 | // Built-in denylist is the active guard. |
| 131 | if (matchesAny(id, NONREASONING_FAMILIES)) return false; |
| 132 | // Built-in reasoning list short-circuits to capable. |
| 133 | if (matchesAny(id, REASONING_FAMILIES)) return true; |
| 134 | |
| 135 | // Unknown → assume reasoning-capable (fail open). |
| 136 | return true; |
| 137 | } |
no test coverage detected
searching dependent graphs…