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

Function handleFastModeOverageRejection

src/utils/fastMode.ts:295–313  ·  view source on GitHub ↗
(reason: string | null)

Source from the content-addressed store, hash-verified

293 * ran out of credits) and notifies with a reason-specific message.
294 */
295export 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
315export function isFastModeCooldown(): boolean {
316 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