{"record":{"id":"33534d343eb7e17c","repo":"can1357/oh-my-pi","slug":"thinking-effort-effort-is-not-supported-by-mo","errorCode":null,"errorMessage":"Thinking effort ${effort} is not supported by ${model.provider}/${model.id}. Supported efforts: ${levels.join(\", \")}","messagePattern":"Thinking effort (.+?) is not supported by (.+?)/(.+?)\\. Supported efforts: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/catalog/src/model-thinking.ts","lineNumber":73,"sourceCode":"\n\tlet clamped: Effort | undefined;\n\tfor (const effort of levels) {\n\t\tif (THINKING_EFFORTS.indexOf(effort) > requestedIndex) {\n\t\t\tbreak;\n\t\t}\n\t\tclamped = effort;\n\t}\n\n\treturn clamped ?? levels[0];\n}\n\nexport function requireSupportedEffort<TApi extends Api>(model: ApiModel<TApi>, effort: Effort): Effort {\n\tif (!model.reasoning) {\n\t\tthrow new Error(`Model ${model.provider}/${model.id} does not support thinking`);\n\t}\n\tconst levels = getSupportedEfforts(model);\n\tif (!levels.includes(effort)) {\n\t\tthrow new Error(\n\t\t\t`Thinking effort ${effort} is not supported by ${model.provider}/${model.id}. Supported efforts: ${levels.join(\", \")}`,\n\t\t);\n\t}\n\treturn effort;\n}\n\n/** Maps a normalized thinking effort to Google's `thinkingLevel` enum values.\n * When a collapsed family routes `minimal` onto the same wire id as `low`\n * (Antigravity Gemini 3.6/3.7 Flash), emit `LOW` — Cloud Code Assist rejects\n * `MINIMAL` on those `-low` SKUs.\n */\nexport function mapEffortToGoogleThinkingLevel<TApi extends Api>(\n\teffort: Effort,\n\tmodel?: ApiModel<TApi>,\n): \"MINIMAL\" | \"LOW\" | \"MEDIUM\" | \"HIGH\" {\n\tif (effort === Effort.Minimal) {\n\t\tconst routing = model?.thinking?.effortRouting;\n\t\tif (routing?.[Effort.Minimal] && routing[Effort.Minimal] === routing[Effort.Low]) {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/catalog/src/model-thinking.ts#L55-L91","documentation":"The model supports thinking, but the requested Effort is not among the levels the model accepts (getSupportedEfforts from the catalog/KDL rules). requireSupportedEffort throws with the list of supported efforts so the caller can pick a valid one.","triggerScenarios":"Passing e.g. effort 'high' to a model that only supports ['low','medium'], or 'minimal' on models that predate that level, via effort()/level()/mapped()/getGoogleBudget().","commonSituations":"Config written for one model copied to another; catalog updated and effort ladder changed; OpenAI 'minimal' effort used against Anthropic-style models.","solutions":["Use one of the efforts listed in the error message","Clamp with the level()/supported() helpers which select from getSupportedEfforts","Update the thinking config for this model in your settings","If the ladder is wrong, fix it in the KDL compat rules and run `bun run gen:compat`"],"exampleFix":"// before\nctx.thinking = { effort: \"minimal\" }; // model only supports low|medium|high\n// after\nconst effort = thinkingLevel(model) ?? \"medium\"; // picks a supported level\nctx.thinking = { effort };","handlingStrategy":"validation","validationCode":"import { supported } from \"@oh-my-pi/pi-catalog/model-thinking\";\nconst allowed = supported(model);\nif (!allowed.includes(desiredEffort)) {\n  desiredEffort = allowed[allowed.length - 1]; // clamp to max supported\n}\n","typeGuard":"function isSupportedEffort(model: ApiModel<Api>, effort: Effort): boolean {\n  return supported(model).includes(effort);\n}","tryCatchPattern":"try {\n  ctx.thinking = { effort };\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"Supported efforts:\")) {\n    const levels = err.message.split(\"Supported efforts: \")[1]?.split(\", \") ?? [];\n    ctx.thinking = { effort: (levels.at(-1) as Effort) ?? undefined };\n  } else throw err;\n}","preventionTips":["Always derive efforts from supported(model) rather than literals","Clamp user-supplied effort settings against the model's ladder","Regenerate compat rules (bun run gen:compat) after KDL edits so ladders stay accurate"],"tags":["thinking","effort","model-config"],"backgroundTag":"unsupported-thinking-effort","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}