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

Function triggerFastModeCooldown

source code/utils/fastMode.ts:216–235  ·  view source on GitHub ↗
(
  resetTimestamp: number,
  reason: CooldownReason,
)

Source from the content-addressed store, hash-verified

214}
215
216export function triggerFastModeCooldown(
217 resetTimestamp: number,
218 reason: CooldownReason,
219): void {
220 if (!isFastModeEnabled()) {
221 return
222 }
223 runtimeState = { status: 'cooldown', resetAt: resetTimestamp, reason }
224 hasLoggedCooldownExpiry = false
225 const cooldownDurationMs = resetTimestamp - Date.now()
226 logForDebugging(
227 `Fast mode cooldown triggered (${reason}), duration ${Math.round(cooldownDurationMs / 1000)}s`,
228 )
229 logEvent('tengu_fast_mode_fallback_triggered', {
230 cooldown_duration_ms: cooldownDurationMs,
231 cooldown_reason:
232 reason as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
233 })
234 cooldownTriggered.emit(resetTimestamp, reason)
235}
236
237export function clearFastModeCooldown(): void {
238 runtimeState = { status: 'active' }

Callers 1

withRetryFunction · 0.85

Calls 4

isFastModeEnabledFunction · 0.85
logForDebuggingFunction · 0.85
logEventFunction · 0.85
emitMethod · 0.80

Tested by

no test coverage detected