MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / triggerFastModeCooldown

Function triggerFastModeCooldown

src/utils/fastMode.ts:217–236  ·  view source on GitHub ↗
(
  resetTimestamp: number,
  reason: CooldownReason,
)

Source from the content-addressed store, hash-verified

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

Callers 1

withRetryFunction · 0.85

Calls 5

isFastModeEnabledFunction · 0.85
logEventFunction · 0.85
nowMethod · 0.80
logForDebuggingFunction · 0.70
emitMethod · 0.45

Tested by

no test coverage detected