{"record":{"id":"36db636631ee317c","repo":"earendil-works/pi","slug":"unsupported-google-thinking-level-mapping-for-mo","errorCode":null,"errorMessage":"Unsupported Google thinking level mapping for ${model.provider}/${model.id}: ${level} -> ${String(mapped)}","messagePattern":"Unsupported Google thinking level mapping for (.+?)/(.+?): (.+?) -> (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/ai/src/api/google-shared.ts","lineNumber":47,"sourceCode":"export type ResolvedGoogleThinkingLevel = Exclude<ThinkingLevel, \"xhigh\" | \"max\">;\n\n/** Resolve a supported pi level or model-specific Google mapping to a standard Google level. */\nexport function resolveGoogleThinkingLevel<T extends GoogleApiType>(\n\tmodel: Model<T>,\n\tlevel: ModelThinkingLevel,\n): ResolvedGoogleThinkingLevel {\n\tif (level === \"off\") return \"high\";\n\n\tconst mapped = model.thinkingLevelMap?.[level];\n\tconst resolvedLevel = typeof mapped === \"string\" ? mapped.toLowerCase() : level;\n\tswitch (resolvedLevel) {\n\t\tcase \"minimal\":\n\t\tcase \"low\":\n\t\tcase \"medium\":\n\t\tcase \"high\":\n\t\t\treturn resolvedLevel;\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t`Unsupported Google thinking level mapping for ${model.provider}/${model.id}: ${level} -> ${String(mapped)}`,\n\t\t\t);\n\t}\n}\n\n/**\n * Determines whether a streamed Gemini `Part` should be treated as \"thinking\".\n *\n * Protocol note (Gemini / Vertex AI thought signatures):\n * - `thought: true` is the definitive marker for thinking content (thought summaries).\n * - `thoughtSignature` is an encrypted representation of the model's internal thought process\n *   used to preserve reasoning context across multi-turn interactions.\n * - `thoughtSignature` can appear on ANY part type (text, functionCall, etc.) - it does NOT\n *   indicate the part itself is thinking content.\n * - For non-functionCall responses, the signature appears on the last part for context replay.\n * - When persisting/replaying model outputs, signature-bearing parts must be preserved as-is;\n *   do not merge/move signatures across parts.\n *","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/ai/src/api/google-shared.ts#L29-L65","documentation":"Error \"Unsupported Google thinking level mapping for ${model.provider}/${model.id}: ${level} -> ${String(mapped)}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/ai/src/api/google-shared.ts:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported thinking level for this Google model, or update the thinking-level mapping table."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}