(
session:
| Pick<ResolvedAuthSession, 'headersKind' | 'providerPlan' | 'scopes'>
| null
| undefined,
model: string | null,
isFastMode: boolean,
isOpus1mMerged: boolean,
)
| 4 | import { has1mContext } from './context.js' |
| 5 | |
| 6 | export function isBilledAsExtraUsageForSession( |
| 7 | session: |
| 8 | | Pick<ResolvedAuthSession, 'headersKind' | 'providerPlan' | 'scopes'> |
| 9 | | null |
| 10 | | undefined, |
| 11 | model: string | null, |
| 12 | isFastMode: boolean, |
| 13 | isOpus1mMerged: boolean, |
| 14 | ): boolean { |
| 15 | if (!hasOauthCommandAvailabilitySession(session)) return false |
| 16 | if (isFastMode) return true |
| 17 | if (model === null || !has1mContext(model)) return false |
| 18 | |
| 19 | const m = model |
| 20 | .toLowerCase() |
| 21 | .replace(/\[1m\]$/, '') |
| 22 | .trim() |
| 23 | const isOpus46 = m === 'opus' || m.includes('opus-4-6') |
| 24 | const isSonnet46 = m === 'sonnet' || m.includes('sonnet-4-6') |
| 25 | |
| 26 | if (isOpus46 && isOpus1mMerged) return false |
| 27 | |
| 28 | return isOpus46 || isSonnet46 |
| 29 | } |
| 30 | |
| 31 | export function isBilledAsExtraUsage( |
| 32 | model: string | null, |
no test coverage detected