( model: string, appStateEffortValue: EffortValue | undefined, )
| 150 | * 'unset', or no default exists for the model). |
| 151 | */ |
| 152 | export function resolveAppliedEffort( |
| 153 | model: string, |
| 154 | appStateEffortValue: EffortValue | undefined, |
| 155 | ): EffortValue | undefined { |
| 156 | const envOverride = getEffortEnvOverride() |
| 157 | if (envOverride === null) { |
| 158 | return undefined |
| 159 | } |
| 160 | const resolved = |
| 161 | envOverride ?? appStateEffortValue ?? getDefaultEffortForModel(model) |
| 162 | // API rejects 'max' on non-Opus-4.6 models — downgrade to 'high'. |
| 163 | if (resolved === 'max' && !modelSupportsMaxEffort(model)) { |
| 164 | return 'high' |
| 165 | } |
| 166 | return resolved |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Resolve the effort level to show the user. Wraps resolveAppliedEffort |
no test coverage detected