EffortManager class

Manages effort levels, model support, and defaults.

Constructors

EffortManager(EffortConfig _config)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isEffortEnvUnset bool
Check if the env override is explicitly set to 'unset' or 'auto'.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

convertEffortValueToLevel(EffortValue value) EffortLevel
Convert an effort value to its named level.
getDefaultEffortForModel(String model) EffortValue?
Get the default effort for a model.
getDisplayedEffortLevel(String model, EffortValue? appStateEffort) EffortLevel
Resolve the effort level to show the user.
getEffortEnvOverride() EffortValue?
Get the effort value from the environment variable override. Returns null for 'unset'/'auto', or the parsed value. Returns a special sentinel for "env not set".
getEffortLevelDescription(EffortLevel level) String
Get user-facing description for effort levels.
getEffortSuffix(String model, EffortValue? effortValue) String
Build the with {level} effort suffix shown in Logo/Spinner.
getEffortValueDescription(EffortValue value) String
Get user-facing description for effort values.
getInitialEffortSetting() EffortLevel?
Get the initial effort setting from settings.
getOpusDefaultEffortConfig() OpusDefaultEffortConfig
Opus default effort configuration.
isEffortLevel(String value) bool
Check if a value is a valid effort level string.
modelSupportsEffort(String model) bool
Check if a model supports the effort parameter.
modelSupportsMaxEffort(String model) bool
Check if a model supports 'max' effort (Opus 4.6 only for public models).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseEffortValue(Object? value) EffortValue?
Parse an effort value from an unknown input.
resolveAppliedEffort(String model, EffortValue? appStateEffortValue) EffortValue?
Resolve the effort value that will actually be sent to the API. Follows the full precedence chain: env MAGE_EFFORT_LEVEL -> appState.effortValue -> model default
resolvePickerEffortPersistence({required EffortLevel? picked, required EffortLevel modelDefault, required EffortLevel? priorPersisted, required bool toggledInPicker}) EffortLevel?
Decide what effort level to persist when the user selects a model in ModelPicker.
toPersistableEffort(EffortValue? value) EffortLevel?
Numeric values are model-default only and not persisted. 'max' is session-scoped for external users (ants can persist it).
toString() String
A string representation of this object.
inherited

Operators

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