{"record":{"id":"e977ab5d4f508a98","repo":"aaif-goose/goose","slug":"invalid-thinking-effort","errorCode":null,"errorMessage":"invalid thinking effort","messagePattern":"invalid thinking effort","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-cli/src/commands/configure.rs","lineNumber":976,"sourceCode":"    };\n\n    {\n        let supports_thinking = match temp_provider.fetch_model_info(&model).await {\n            Ok(model_info) => model_info.reasoning,\n            Err(_) => goose_providers::model::ModelConfig::new(&model).is_reasoning_model(),\n        };\n\n        if supports_thinking {\n            let effort: ThinkingEffort = cliclack::select(\"Select thinking effort:\")\n                .item(\"off\", \"Off - No extended thinking\", \"\")\n                .item(\"low\", \"Low - Better latency, lighter reasoning\", \"\")\n                .item(\"medium\", \"Medium - Moderate thinking\", \"\")\n                .item(\"high\", \"High - Deep reasoning\", \"\")\n                .item(\"max\", \"Max - No constraints on thinking depth\", \"\")\n                .initial_value(\"off\")\n                .interact()?\n                .parse()\n                .map_err(|_| anyhow::anyhow!(\"invalid thinking effort\"))?;\n            config.set_goose_thinking_effort(effort)?;\n        }\n    }\n\n    // Test the configuration\n    let spin = spinner();\n    spin.start(\"Checking your configuration...\");\n\n    let toolshim_enabled = std::env::var(\"GOOSE_TOOLSHIM\")\n        .map(|val| val == \"1\" || val.to_lowercase() == \"true\")\n        .unwrap_or(false);\n    let toolshim_model = std::env::var(\"GOOSE_TOOLSHIM_OLLAMA_MODEL\").ok();\n\n    match test_provider_configuration(&provider_name, &model, toolshim_enabled, toolshim_model)\n        .await\n    {\n        Ok(()) => {\n            goose::config::set_active_provider(config, &provider_name, &model)?;","sourceCodeStart":958,"sourceCodeEnd":994,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-cli/src/commands/configure.rs#L958-L994","documentation":"After the interactive 'Select thinking effort' prompt, the chosen string is parsed with ThinkingEffort::from_str, which accepts off/disabled/none, low, medium/med, high, and max/xhigh. A parse failure is collapsed into this generic message. All menu items (off/low/medium/high/max) are valid variants, so in practice this only fires on menu/enum drift between versions or non-menu input reaching the parse.","triggerScenarios":"A build where the cliclack menu offers a value ThinkingEffort::from_str rejects (menu/enum drift after a patch), or programmatic/expect-driven input feeding an unexpected string to the select prompt.","commonSituations":"Forked builds that add menu entries without extending the enum; automation driving the configure TUI with scripted stdin; version skew between a wrapper tool and goose.","solutions":["Re-run `goose configure` and pick one of the offered options (off/low/medium/high/max)","Update goose so the menu and the ThinkingEffort enum stay in sync","Embedders: validate candidate strings with ThinkingEffort::from_str before the prompt and surface the parser's own error message","Set the value directly through configuration instead of the wizard if the option is exposed"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// Rust: validate before the prompt and surface the parser's own message\nlet raw: String = cliclack::select(\"Select thinking effort:\") /* items */ .interact()?;\nlet effort: ThinkingEffort = raw.parse().map_err(|e: String| anyhow::anyhow!(\"{e}\"))?;","typeGuard":"fn is_valid_effort(s: &str) -> bool {\n    matches!(\n        s.to_lowercase().as_str(),\n        \"off\" | \"disabled\" | \"none\" | \"low\" | \"medium\" | \"med\" | \"high\" | \"max\" | \"xhigh\"\n    )\n}","tryCatchPattern":null,"preventionTips":["Generate prompt menus from the enum variants, not hand-listed strings","Propagate the parser's error text instead of replacing it with a generic one","Property-test FromStr against every menu item in CI"],"tags":["configuration","thinking","parse-error","cli"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}