{"record":{"id":"e248ab0c5848f79a","repo":"can1357/oh-my-pi","slug":"model-model-provider-model-id-does-not-suppo","errorCode":null,"errorMessage":"Model ${model.provider}/${model.id} does not support thinking","messagePattern":"Model (.+?)/(.+?) does not support thinking","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/catalog/src/model-thinking.ts","lineNumber":69,"sourceCode":"\tconst requestedIndex = THINKING_EFFORTS.indexOf(requested);\n\tif (requestedIndex === -1) {\n\t\treturn undefined;\n\t}\n\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>,","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/catalog/src/model-thinking.ts#L51-L87","documentation":"requireSupportedEffort validates that a model can do extended/reasoning 'thinking' before applying an effort level. If the ApiModel's reasoning flag is falsy the model cannot accept any thinking effort, so any request to set one throws. It is the gate used by level, mapped, effort, getGoogleBudget, and supported.","triggerScenarios":"Calling model-thinking helpers (effort(), level(), mapped(), getGoogleBudget(), requireSupportedEffort()) with an Effort value on a model whose `reasoning` property is undefined/false.","commonSituations":"Hard-coding reasoning: 'high' for a non-reasoning model, a model id swap to a non-thinking variant, or a dynamically discovered model lacking reasoning metadata.","solutions":["Check model.reasoning before requesting an effort level","Pick a different model id that supports thinking (e.g. a reasoning-class model)","Remove the thinking/effort config from the request for this model","If the model does support thinking, fix discovery/catalog metadata so `reasoning` is set"],"exampleFix":"// before\nconst model = await getModel(\"my-provider/basic-model\");\nctx.thinking = { effort: \"high\" };\n// after\nconst model = await getModel(\"my-provider/basic-model\");\nif (model.reasoning) ctx.thinking = { effort: \"high\" };","handlingStrategy":"validation","validationCode":"import { supported } from \"@oh-my-pi/pi-catalog/model-thinking\";\nif (!model.reasoning || !supported(model).length) {\n  // skip thinking config for this model\n}\n","typeGuard":"function supportsThinking(model: ApiModel<Api>): boolean {\n  return model.reasoning === true;\n}","tryCatchPattern":"try {\n  ctx.thinking = { effort: requireSupportedEffort(model, desiredEffort) };\n} catch (err) {\n  if (err instanceof Error && /does not support thinking/.test(err.message)) {\n    ctx.thinking = undefined; // degrade to non-thinking request\n  } else throw err;\n}","preventionTips":["Gate thinking config on model.reasoning before applying it","Use the supported()/level() helpers instead of hard-coding efforts","Re-check reasoning flags after switching model ids or updating the catalog"],"tags":["thinking","reasoning","model-config"],"backgroundTag":"model-does-not-support-thinking","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}