aaif-goose/goose · error

Could not configure fallback provider: invalid model {}

Error message

Could not configure fallback provider: invalid model {}

What it means

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.

Source

Thrown at crates/goose/src/agents/agent.rs:3618

                            provider_name
                        )
                    })?;

                tracing::warn!(
                    "Session provider '{}' unavailable, falling back to '{}'",
                    provider_name,
                    fallback_provider_name
                );

                let fallback_model_name = config.get_goose_model().ok().ok_or_else(|| {
                    anyhow!("Could not configure fallback provider: missing model")
                })?;
                let fallback_model_config = crate::model_config::model_config_from_user_config(
                    &fallback_provider_name,
                    &fallback_model_name,
                )
                .map_err(|e| {
                    anyhow!("Could not configure fallback provider: invalid model {}", e)
                })?;

                let fallback_provider = crate::providers::create_with_working_dir(
                    &fallback_provider_name,
                    extensions,
                    session.working_dir.clone(),
                )
                .await
                .map_err(|error| {
                    provider_creation_error(
                        error,
                        format!(
                            "Could not create provider '{provider_name}' or fallback '{fallback_provider_name}'"
                        ),
                    )
                })?;

                if let Err(e) = self

View on GitHub (pinned to 3810898a74)

Solutions

  1. Read the '{}' detail to identify the offending key
  2. Fix or remove the invalid key in config.yaml and resume again
  3. Run 'goose configure' to regenerate a consistent config
  4. Restore the session's original provider so the fallback path is not taken

Example fix

# before
GOOSE_TOOLSHIM: yes-please

# after
GOOSE_TOOLSHIM: true   # or remove the key
Defensive patterns

Strategy: validation

Validate before calling

// Rust — validate global model params before relying on the fallback path
model_config_from_user_config(
    &fallback_provider_name,
    &Config::global().get_goose_model()?,
)?; // dry-run the exact call restore will make

Prevention

When it happens

Trigger: 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.

Common situations: Hand-edited or partially migrated config.yaml; environment variables overriding config with malformed values; configs that worked until the fallback path was first exercised.

Related errors


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/18acccf28e5df1d8. Report an issue: GitHub.