Hmbown/CodeWhale · error · anyhow::Error

The saved provider identity is shadowed by another route

Error message

The saved provider identity is shadowed by another route

What it means

The saved provider pin for Deepseek resolves to a provider identity whose provider field does not match the requested provider — meaning another route (profile pin, scoped identity) shadows the saved default. The command refuses rather than showing a setting for the wrong route.

Solutions

  1. Inspect profiles/route pins in config for entries shadowing Deepseek
  2. Remove or correct the shadowing pin with the config command
  3. Re-save the Deepseek default model so the identity resolves to Deepseek
  4. Use the profile that actually owns the setting
Defensive patterns

Strategy: validation

Validate before calling

// before showing the setting, verify the pin resolves to the same provider
let identity = config.resolve_provider_pin_identity("deepseek")?;
assert_eq!(identity.provider, "deepseek", "Deepseek pin is shadowed by another route");

Try / catch

match saved_deepseek_default_model(app) {
    Err(e) if e.to_string().contains("shadowed by another route") => {
        open_route_settings_to_fix_pin();
    }
    other => other?,
}

Prevention

When it happens

Trigger: saved_deepseek_default_model calls resolve_provider_pin_identity(provider.as_str()) and the returned identity.provider differs from the requested provider, tripping `anyhow::ensure!` (crates/tui/src/commands/groups/config/config.rs:1438).

Common situations: A profile or route pin re-routes Deepseek to another provider, a stale saved identity after reconfiguring routes, or editing config files by hand so the pin points at a different provider.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/d51ca8ca75e3ba74. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/commands/groups/config/config.rs:1438

        .map_err(|error| format!("Failed to resolve config: {error}"))?;
    let read = || -> anyhow::Result<String> {
        let store = codewhale_config::ConfigStore::load(Some(path.clone()))?;
        let mut config = Config::from_saved_document(
            store.original_body().unwrap_or(""),
            app.config_profile.as_deref(),
        )?;
        if app.config_profile.is_none() && crate::config::is_home_config_path(&path) {
            config.apply_saved_selection(&Settings::load_legacy_route_preferences_read_only()?);
        }
        let provider = if app.api_provider == ApiProvider::DeepseekCN {
            ApiProvider::DeepseekCN
        } else {
            ApiProvider::Deepseek
        };
        let identity = config
            .resolve_provider_pin_identity(provider.as_str())
            .map_err(anyhow::Error::msg)?;
        anyhow::ensure!(
            identity.provider == provider,
            "The saved provider identity is shadowed by another route"
        );
        config.scope_to_provider_identity(&identity);
        Ok(config.default_model())
    };
    read().map_err(|error| format!("Failed to read saved model config: {error}"))
}

fn subagents_status(app: &App) -> CommandResult {
    let config = match load_command_config(app) {
        Ok(config) => config,
        Err(err) => return CommandResult::error(err),
    };
    let path = crate::config_persistence::config_toml_path(app.config_path.as_deref())
        .map(|path| path.display().to_string())
        .unwrap_or_else(|_| "(unresolved)".to_string());
    let disabled_reason = config.subagents_disabled_reason();

View on GitHub (pinned to 73e0f67d83)