MCPcopy Create free account
hub / github.com/Noumena-Network/code / handleFastModeOverageRejection

Function handleFastModeOverageRejection

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

Source from the content-addressed store, hash-verified

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

Callers 1

withRetryFunction · 0.85

Calls 7

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

Tested by

no test coverage detected