{"record":{"id":"18acccf28e5df1d8","repo":"aaif-goose/goose","slug":"could-not-configure-fallback-provider-invalid-mod","errorCode":null,"errorMessage":"Could not configure fallback provider: invalid model {}","messagePattern":"Could not configure fallback provider: invalid model (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose/src/agents/agent.rs","lineNumber":3618,"sourceCode":"                            provider_name\n                        )\n                    })?;\n\n                tracing::warn!(\n                    \"Session provider '{}' unavailable, falling back to '{}'\",\n                    provider_name,\n                    fallback_provider_name\n                );\n\n                let fallback_model_name = config.get_goose_model().ok().ok_or_else(|| {\n                    anyhow!(\"Could not configure fallback provider: missing model\")\n                })?;\n                let fallback_model_config = crate::model_config::model_config_from_user_config(\n                    &fallback_provider_name,\n                    &fallback_model_name,\n                )\n                .map_err(|e| {\n                    anyhow!(\"Could not configure fallback provider: invalid model {}\", e)\n                })?;\n\n                let fallback_provider = crate::providers::create_with_working_dir(\n                    &fallback_provider_name,\n                    extensions,\n                    session.working_dir.clone(),\n                )\n                .await\n                .map_err(|error| {\n                    provider_creation_error(\n                        error,\n                        format!(\n                            \"Could not create provider '{provider_name}' or fallback '{fallback_provider_name}'\"\n                        ),\n                    )\n                })?;\n\n                if let Err(e) = self","sourceCodeStart":3600,"sourceCodeEnd":3636,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/agents/agent.rs#L3600-L3636","documentation":"Thrown when building the fallback provider's ModelConfig fails during session restore. The '{}' carries the underlying error from model_config_from_user_config — invalid global config values such as negative GOOSE_TEMPERATURE, unparsable GOOSE_TOOLSHIM, or malformed GOOSE_MAX_TOKENS/GOOSE_CONTEXT_LIMIT. Same root causes as 'invalid model' on the primary path, hit after the provider fallback already succeeded.","triggerScenarios":"Resuming with an unavailable session provider plus a valid fallback GOOSE_PROVIDER, while a global model-related config key is invalid so materializing the fallback model fails.","commonSituations":"Hand-edited or partially migrated config.yaml; environment variables overriding config with malformed values; configs that worked until the fallback path was first exercised.","solutions":["Read the '{}' detail to identify the offending key","Fix or remove the invalid key in config.yaml and resume again","Run 'goose configure' to regenerate a consistent config","Restore the session's original provider so the fallback path is not taken"],"exampleFix":"# before\nGOOSE_TOOLSHIM: yes-please\n\n# after\nGOOSE_TOOLSHIM: true   # or remove the key","handlingStrategy":"validation","validationCode":"// Rust — validate global model params before relying on the fallback path\nmodel_config_from_user_config(\n    &fallback_provider_name,\n    &Config::global().get_goose_model()?,\n)?; // dry-run the exact call restore will make","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep GOOSE_TEMPERATURE / GOOSE_TOOLSHIM / GOOSE_MAX_TOKENS well-formed","Run 'goose doctor' after config changes"],"tags":["configuration","model","validation","fallback","session-restore"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}