can1357/oh-my-pi · error · RangeError
${modelName} has no supported thinking effort at or below ta
Error message
${modelName} has no supported thinking effort at or below task.maxEffort=${maxEffort} What it means
resolveTaskEffortLevel clamps the model's thinking effort to a configured ceiling (task.maxEffort) by picking the highest supported effort at or below that ceiling. If the model publishes no supported effort level within the ceiling range (e.g. its lowest supported effort exceeds maxEffort), no valid clamp exists and it throws a RangeError naming the model.
Source
Thrown at packages/coding-agent/src/thinking.ts:308
if (supported.length === 0) return undefined;
let resolved: Effort;
switch (effort) {
case "lo":
resolved = supported[0];
break;
case "med":
resolved = supported[(supported.length - 1) >> 1];
break;
case "hi":
resolved = supported[supported.length - 1];
break;
}
if (maxEffort === undefined) return resolved;
const maxIndex = THINKING_EFFORTS.indexOf(maxEffort);
const ceiling = supported.findLast(candidate => THINKING_EFFORTS.indexOf(candidate) <= maxIndex);
if (ceiling === undefined) {
const modelName = model ? `${model.provider}/${model.id}` : "Selected model";
throw new RangeError(`${modelName} has no supported thinking effort at or below task.maxEffort=${maxEffort}`);
}
return THINKING_EFFORTS.indexOf(resolved) > THINKING_EFFORTS.indexOf(ceiling) ? ceiling : resolved;
}
/**
* Clamps a concrete thinking selector to a per-session effort ceiling (e.g. a
* task spawn's `task.maxEffort`-capped effort hint). `off`/`inherit`/
* `undefined` pass through, as do levels already at or below the ceiling.
* Levels above it snap to the highest model-supported effort at or below the
* ceiling. A model whose floor exceeds the ceiling has nothing valid to snap
* to; the requested level is returned unchanged and the caller is responsible
* for rejecting or skipping such models (see {@link modelSupportsEffortCeiling}).
*/
export function clampThinkingLevelToCeiling(
model: Model | undefined,
level: Effort | undefined,
ceiling: Effort | undefined,
): Effort | undefined;View on GitHub (pinned to 9690622007)
Solutions
- Raise `task.maxEffort` to at least the model's minimum supported effort (e.g. minimal -> low/medium)
- Remove the task.maxEffort setting to let the model use its default effort
- Use a model whose effort ladder includes a level at or below your configured ceiling
Example fix
// before
{ "task": { "maxEffort": "minimal" } } // model only supports medium+
// after
{ "task": { "maxEffort": "medium" } } Defensive patterns
Strategy: validation
Validate before calling
import { THINKING_EFFORTS } from "./thinking";
function effortCeilingOk(supported: string[], maxEffort: string): boolean {
const maxIndex = THINKING_EFFORTS.indexOf(maxEffort as never);
return supported.some(c => THINKING_EFFORTS.indexOf(c as never) <= maxIndex);
} Try / catch
try {
const effort = resolveTaskEffortLevel(model, resolved, maxEffort);
} catch (err) {
if (err instanceof RangeError && err.message.includes("task.maxEffort")) {
logger.warn("maxEffort below model minimum; using model default");
return undefined;
}
throw err;
} Prevention
- Set task.maxEffort at or above the lowest effort of every model you use
- Drop the maxEffort setting when switching to models with higher minimum efforts
- Keep the model catalog updated so supported-effort ladders are accurate
When it happens
Trigger: Calling resolveTaskEffortLevel (via effortLevel) with a model whose THINKING_EFFORTS-supported list has no entry with index <= the maxEffort index — i.e. maxEffort is set below the model's minimum supported effort.
Common situations: Configuring `task.maxEffort: minimal` for a model that only supports medium/high; model catalog updates changing a model's supported effort ladder; mixing configs written for one model with another.
Related errors
- No model configured
- Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL
- Cannot register custom API "${api}": built-in API names are
- Unable to read OMP_AUTH_BROKER_ACCOUNT_POOL_FILE at ${filePa
- OMP_AUTH_BROKER_ACCOUNT_POOL_FILE must contain a JSON object
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/1853f2e881c723c6.
Report an issue: GitHub.