(limits: ClaudeAILimits)
| 381 | * Used for transient notifications when entering overage mode |
| 382 | */ |
| 383 | export function getUsingOverageText(limits: ClaudeAILimits): string { |
| 384 | const sessionState = getCurrentRateLimitMessageSessionState() |
| 385 | const resetTime = limits.resetsAt |
| 386 | ? formatResetTime(limits.resetsAt, true) |
| 387 | : '' |
| 388 | |
| 389 | let limitName = '' |
| 390 | if (limits.rateLimitType === 'five_hour') { |
| 391 | limitName = 'session limit' |
| 392 | } else if (limits.rateLimitType === 'seven_day') { |
| 393 | limitName = 'weekly limit' |
| 394 | } else if (limits.rateLimitType === 'seven_day_opus') { |
| 395 | limitName = 'priority model limit' |
| 396 | } else if (limits.rateLimitType === 'seven_day_sonnet') { |
| 397 | const isProOrEnterprise = |
| 398 | sessionState.subscriptionType === 'pro' || |
| 399 | sessionState.subscriptionType === 'enterprise' |
| 400 | // For pro and enterprise, standard model limit is the same as weekly |
| 401 | limitName = isProOrEnterprise ? 'weekly limit' : 'standard model limit' |
| 402 | } |
| 403 | |
| 404 | if (!limitName) { |
| 405 | return 'Now using extra usage' |
| 406 | } |
| 407 | |
| 408 | const resetMessage = resetTime |
| 409 | ? ` · Your ${limitName} resets ${resetTime}` |
| 410 | : '' |
| 411 | return `You're now using extra usage${resetMessage}` |
| 412 | } |
| 413 | |
| 414 | function formatLimitReachedText( |
| 415 | limit: string, |
no test coverage detected