MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isOpus1mMergeEnabled

Function isOpus1mMergeEnabled

src/utils/model/model.ts:314–332  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

312}
313
314export 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
334export function renderModelSetting(setting: ModelName | ModelAlias): string {
335 if (setting === 'opusplan') {

Callers 11

onChangeMainModelConfigFunction · 0.85
PromptInputFunction · 0.85
getFastModeModelFunction · 0.85
getModelOptionsBaseFunction · 0.85
ModelPickerWrapperFunction · 0.85
setModelFunction · 0.85
isOpus1mUnavailableFunction · 0.85
migrateOpusToOpus1mFunction · 0.85

Calls 5

is1mContextDisabledFunction · 0.85
isProSubscriberFunction · 0.85
getAPIProviderFunction · 0.85
getSubscriptionTypeFunction · 0.85
isClaudeAISubscriberFunction · 0.50

Tested by

no test coverage detected