{"record":{"id":"1853f2e881c723c6","repo":"can1357/oh-my-pi","slug":"modelname-has-no-supported-thinking-effort-at-o","errorCode":null,"errorMessage":"${modelName} has no supported thinking effort at or below task.maxEffort=${maxEffort}","messagePattern":"(.+?) has no supported thinking effort at or below task\\.maxEffort=(.+?)","errorType":"exception","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/thinking.ts","lineNumber":308,"sourceCode":"\tif (supported.length === 0) return undefined;\n\tlet resolved: Effort;\n\tswitch (effort) {\n\t\tcase \"lo\":\n\t\t\tresolved = supported[0];\n\t\t\tbreak;\n\t\tcase \"med\":\n\t\t\tresolved = supported[(supported.length - 1) >> 1];\n\t\t\tbreak;\n\t\tcase \"hi\":\n\t\t\tresolved = supported[supported.length - 1];\n\t\t\tbreak;\n\t}\n\tif (maxEffort === undefined) return resolved;\n\tconst maxIndex = THINKING_EFFORTS.indexOf(maxEffort);\n\tconst ceiling = supported.findLast(candidate => THINKING_EFFORTS.indexOf(candidate) <= maxIndex);\n\tif (ceiling === undefined) {\n\t\tconst modelName = model ? `${model.provider}/${model.id}` : \"Selected model\";\n\t\tthrow new RangeError(`${modelName} has no supported thinking effort at or below task.maxEffort=${maxEffort}`);\n\t}\n\treturn THINKING_EFFORTS.indexOf(resolved) > THINKING_EFFORTS.indexOf(ceiling) ? ceiling : resolved;\n}\n\n/**\n * Clamps a concrete thinking selector to a per-session effort ceiling (e.g. a\n * task spawn's `task.maxEffort`-capped effort hint). `off`/`inherit`/\n * `undefined` pass through, as do levels already at or below the ceiling.\n * Levels above it snap to the highest model-supported effort at or below the\n * ceiling. A model whose floor exceeds the ceiling has nothing valid to snap\n * to; the requested level is returned unchanged and the caller is responsible\n * for rejecting or skipping such models (see {@link modelSupportsEffortCeiling}).\n */\nexport function clampThinkingLevelToCeiling(\n\tmodel: Model | undefined,\n\tlevel: Effort | undefined,\n\tceiling: Effort | undefined,\n): Effort | undefined;","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/thinking.ts#L290-L326","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\n{ \"task\": { \"maxEffort\": \"minimal\" } }  // model only supports medium+\n// after\n{ \"task\": { \"maxEffort\": \"medium\" } }","handlingStrategy":"validation","validationCode":"import { THINKING_EFFORTS } from \"./thinking\";\nfunction effortCeilingOk(supported: string[], maxEffort: string): boolean {\n\tconst maxIndex = THINKING_EFFORTS.indexOf(maxEffort as never);\n\treturn supported.some(c => THINKING_EFFORTS.indexOf(c as never) <= maxIndex);\n}","typeGuard":null,"tryCatchPattern":"try {\n\tconst effort = resolveTaskEffortLevel(model, resolved, maxEffort);\n} catch (err) {\n\tif (err instanceof RangeError && err.message.includes(\"task.maxEffort\")) {\n\t\tlogger.warn(\"maxEffort below model minimum; using model default\");\n\t\treturn undefined;\n\t}\n\tthrow err;\n}","preventionTips":["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"],"tags":["configuration","thinking-effort","model"],"backgroundTag":"no-supported-effort-below-max","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}