()
| 312 | } |
| 313 | |
| 314 | export function isOpus1mMergeEnabled(): boolean { |
| 315 | if ( |
| 316 | is1mContextDisabled() || |
| 317 | isProSubscriber() || |
| 318 | getAPIProvider() !== 'firstParty' |
| 319 | ) { |
| 320 | return false |
| 321 | } |
| 322 | // Fail closed when a subscriber's subscription type is unknown. The VS Code |
| 323 | // config-loading subprocess can have OAuth tokens with valid scopes but no |
| 324 | // subscriptionType field (stale or partial refresh). Without this guard, |
| 325 | // isProSubscriber() returns false for such users and the merge leaks |
| 326 | // opus[1m] into the model dropdown — the API then rejects it with a |
| 327 | // misleading "rate limit reached" error. |
| 328 | if (isClaudeAISubscriber() && getSubscriptionType() === null) { |
| 329 | return false |
| 330 | } |
| 331 | return true |
| 332 | } |
| 333 | |
| 334 | export function renderModelSetting(setting: ModelName | ModelAlias): string { |
| 335 | if (setting === 'opusplan') { |
no test coverage detected