MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / handleFastModeOverageRejection

Function handleFastModeOverageRejection

source code/utils/fastMode.ts:297–315  ·  view source on GitHub ↗
(reason: string | null)

Source from the content-addressed store, hash-verified

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

Callers 1

withRetryFunction · 0.85

Calls 7

logForDebuggingFunction · 0.85
logEventFunction · 0.85
isOutOfCreditsReasonFunction · 0.85
updateSettingsForSourceFunction · 0.85
saveGlobalConfigFunction · 0.85
emitMethod · 0.80

Tested by

no test coverage detected