{"record":{"id":"8fca2a19b20bd0dd","repo":"jackwener/OpenCLI","slug":"thinking-thinkingvalue-is-not-available-for","errorCode":null,"errorMessage":"--thinking '${thinkingValue}' is not available for the ${hasModel ? 'selected' : 'current'} model ('${targetModelId}')","messagePattern":"--thinking '(.+?)' is not available for the (.+?) model \\('(.+?)'\\)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/gemini/ask.js","lineNumber":228,"sourceCode":"                    }\n                }\n            }\n\n            // Resolve thinkingValue from early validation.\n            const thinkingValue = String(kwargs.thinking ?? '').trim().toLowerCase();\n\n            // Validate: if we can identify the target model, scope to its\n            // thinking values; otherwise fall back to the union across all models.\n            const targetModelThinking =\n                targetModelId && modelThinkingMap.has(targetModelId)\n                    ? modelThinkingMap.get(targetModelId)\n                    : null;\n\n            if (targetModelThinking) {\n                // Scoped to the target model.\n                if (!targetModelThinking.includes(thinkingValue)) {\n                    const availableForModel = targetModelThinking.sort().join(', ');\n                    throw new ArgumentError(\n                        `--thinking '${thinkingValue}' is not available for the ${hasModel ? 'selected' : 'current'} model ('${targetModelId}')`,\n                        `Model '${targetModelId}' supports: ${availableForModel}. Run \\`opencli gemini models\\` for all models.`,\n                    );\n                }\n            } else if (allThinking.size > 0 && !allThinking.has(thinkingValue)) {\n                // Union fallback when the target model cannot be identified.\n                const availableList = [...allThinking].sort().join(', ');\n                throw new ArgumentError(\n                    `--thinking '${thinkingValue}' is not currently available`,\n                    `Available thinking values: ${availableList}. Run \\`opencli gemini models\\` for details.`,\n                );\n            }\n\n            // Select the requested thinking level before snapshot.\n            const selected = await selectGeminiThinking(page, thinkingValue);\n            if (!selected) {\n                // Build an informative hint from what we know.\n                const hintParts = [];","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/gemini/ask.js#L210-L246","documentation":"An ArgumentError raised when the requested --thinking value is valid in general but not supported by the specific target model. Discovery records per-model thinking options; if the target model's list excludes the value, this scoped error fires with a hint about supported values.","triggerScenarios":"targetModelThinking exists and is non-empty but `!targetModelThinking.includes(thinkingValue)`, e.g. `--thinking 2.5-pro --thinking-level low` on a model that only exposes 'high'.","commonSituations":"Requesting a thinking level a lighter model doesn't offer; model supports fewer thinking options than the union of all models; stale local knowledge of which models support thinking.","solutions":["Pick a --thinking value listed for that model (the hint shows supported values: e.g. high/low)","Run `opencli gemini models` to see per-model thinking support before passing --thinking","Omit --thinking to use the model's default","Choose a different --model that supports the desired thinking level"],"exampleFix":"// before\nopencli gemini ask --model \"2.5 Flash\" --thinking deep-think\n// after\nopencli gemini ask --model \"2.5 Flash\" --thinking low  # value from: opencli gemini models","handlingStrategy":"validation","validationCode":"const models = await getGeminiModels();\nconst target = models.find(m => m.model === modelValue);\nif (target?.thinking && !target.thinking.includes(thinkingValue)) {\n  throw new Error(`Model '${modelValue}' supports: ${target.thinking.sort().join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ask({ model, thinking });\n} catch (e) {\n  if (/is not available for the .* model/.test(e.message)) {\n    console.error(e.hint || e.message); // retry without --thinking or with a listed value\n  } else throw e;\n}","preventionTips":["Check per-model thinking support via `opencli gemini models` before passing --thinking","Pair --thinking with an explicit --model so validation is scoped","Omit --thinking to accept the model default","Update expectations when models gain/lose thinking options"],"tags":["argument-validation","gemini","thinking-level"],"backgroundTag":"invalid-argument-value","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}