{"record":{"id":"c74f7a6242ab33ba","repo":"jackwener/OpenCLI","slug":"thinking-thinkingvalue-is-not-currently-ava","errorCode":null,"errorMessage":"--thinking '${thinkingValue}' is not currently available","messagePattern":"--thinking '(.+?)' is not currently available","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/gemini/ask.js","lineNumber":236,"sourceCode":"            // 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 = [];\n                if (targetModelThinking && targetModelThinking.length > 0) {\n                    hintParts.push(`Model '${targetModelId}' supports: ${targetModelThinking.sort().join(', ')}.`);\n                } else if (allThinking.size > 0) {\n                    hintParts.push(`Available thinking values: ${[...allThinking].sort().join(', ')}.`);\n                }\n                hintParts.push('Run `opencli gemini models` for details.');\n                throw new ArgumentError(\n                    `Could not select thinking level '${thinkingValue}' in the Gemini web UI`,","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/gemini/ask.js#L218-L254","documentation":"An ArgumentError from the union fallback: when the target model could not be identified, the library validates --thinking against the union of all discovered thinking values, and rejects the value if it is not in that set.","triggerScenarios":"targetModelThinking is null/unidentified, allThinking is non-empty, and `!allThinking.has(thinkingValue)` at clis/gemini/ask.js:236.","commonSituations":"Typo in --thinking (e.g. 'hight' instead of 'high'); passing a value from a different CLI; discovery couldn't map the current/target model so only the union check applies.","solutions":["Use one of the values printed in the hint (Available thinking values: ...) exactly","Run `opencli gemini models` for the canonical list of thinking values","Pass an explicit --model so per-model validation applies instead of the union fallback","Fix casing/typo in the --thinking value"],"exampleFix":"// before\nopencli gemini ask --thinking maximum\n// after\nopencli gemini ask --thinking high  # from: opencli gemini models","handlingStrategy":"validation","validationCode":"const models = await getGeminiModels();\nconst all = new Set(models.flatMap(m => m.thinking || []));\nif (!all.has(thinkingValue)) {\n  throw new Error(`Available thinking values: ${[...all].sort().join(', ')}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ask({ thinking });\n} catch (e) {\n  if (/is not currently available/.test(e.message)) {\n    console.error('Use one of the values from: opencli gemini models');\n  } else throw e;\n}","preventionTips":["Use exact values printed by `opencli gemini models`","Avoid hand-typed thinking levels — copy from the CLI output","Pass --model explicitly for per-model validation","Handle the union fallback case when no model is specified"],"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"}