FastModeManager class

Manages fast mode state, availability, cooldown, and org-level status.

Constructors

FastModeManager(FastModeConfig _config)

Properties

cooldownExpired → VoidSignal
final
cooldownTriggered → Signal<({CooldownReason reason, int resetAt})>
final
fastModeModel → String
Get the model string for fast mode.
no setter
fastModeUnavailableReason → String?
Get the reason fast mode is unavailable, or null if it's available.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isCooldown → bool
Check if currently in cooldown.
no setter
isFastModeAvailable → bool
Check if fast mode is available (enabled + no blocking reason).
no setter
isFastModeEnabled → bool
Check if fast mode is enabled (not disabled by environment).
no setter
orgFastModeChanged → Signal<bool>
final
overageRejection → Signal<String>
final
runtimeState → FastModeRuntimeState
Get the current fast mode runtime state, checking for cooldown expiry.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearCooldown() → void
Clear the cooldown state.
getFastModeState(ModelSetting? model, bool? fastModeUserEnabled) → FastModeState
Get the overall fast mode state.
getInitialFastModeSetting(ModelSetting? model) → bool
Get the initial fast mode setting based on availability and settings.
handleOverageRejection(String? reason) → void
Called when a 429 indicates fast mode was rejected because extra usage is not available.
handleRejectedByApi() → void
Called when the API rejects a fast mode request. Permanently disables fast mode using the same flow as when the prefetch discovers the org has it disabled.
isFastModeSupportedByModel(ModelSetting? modelSetting) → bool
Check if a model supports fast mode.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prefetchFastModeStatus() → Future<void>
Prefetch fast mode status from the API.
resolveFastModeStatusFromCache() → void
Resolve orgStatus from the persisted cache without making any API calls.
toString() → String
A string representation of this object.
inherited
triggerCooldown(int resetTimestamp, CooldownReason reason) → void
Trigger a cooldown period for fast mode.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

fastModeModelDisplay → const String
Display name for the fast mode model.
prefetchMinIntervalMs → const int
Minimum interval between prefetch calls.