(reason: string | null)
| 293 | * ran out of credits) and notifies with a reason-specific message. |
| 294 | */ |
| 295 | export function handleFastModeOverageRejection(reason: string | null): void { |
| 296 | const message = getOverageDisabledMessage(reason) |
| 297 | logForDebugging( |
| 298 | `Fast mode overage rejection: ${reason ?? 'unknown'} — ${message}`, |
| 299 | ) |
| 300 | logEvent('tengu_fast_mode_overage_rejected', { |
| 301 | overage_disabled_reason: (reason ?? |
| 302 | 'unknown') as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, |
| 303 | }) |
| 304 | // Disable fast mode permanently unless the user has ran out of credits |
| 305 | if (!isOutOfCreditsReason(reason)) { |
| 306 | updateSettingsForSource('userSettings', { fastMode: undefined }) |
| 307 | saveGlobalConfig(current => ({ |
| 308 | ...current, |
| 309 | penguinModeOrgEnabled: false, |
| 310 | })) |
| 311 | } |
| 312 | overageRejection.emit(message) |
| 313 | } |
| 314 | |
| 315 | export function isFastModeCooldown(): boolean { |
| 316 | return getFastModeRuntimeState().status === 'cooldown' |
no test coverage detected