{"record":{"id":"d51ca8ca75e3ba74","repo":"Hmbown/CodeWhale","slug":"the-saved-provider-identity-is-shadowed-by-another-route","errorCode":null,"errorMessage":"The saved provider identity is shadowed by another route","messagePattern":"The saved provider identity is shadowed by another route","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/commands/groups/config/config.rs","lineNumber":1438,"sourceCode":"        .map_err(|error| format!(\"Failed to resolve config: {error}\"))?;\n    let read = || -> anyhow::Result<String> {\n        let store = codewhale_config::ConfigStore::load(Some(path.clone()))?;\n        let mut config = Config::from_saved_document(\n            store.original_body().unwrap_or(\"\"),\n            app.config_profile.as_deref(),\n        )?;\n        if app.config_profile.is_none() && crate::config::is_home_config_path(&path) {\n            config.apply_saved_selection(&Settings::load_legacy_route_preferences_read_only()?);\n        }\n        let provider = if app.api_provider == ApiProvider::DeepseekCN {\n            ApiProvider::DeepseekCN\n        } else {\n            ApiProvider::Deepseek\n        };\n        let identity = config\n            .resolve_provider_pin_identity(provider.as_str())\n            .map_err(anyhow::Error::msg)?;\n        anyhow::ensure!(\n            identity.provider == provider,\n            \"The saved provider identity is shadowed by another route\"\n        );\n        config.scope_to_provider_identity(&identity);\n        Ok(config.default_model())\n    };\n    read().map_err(|error| format!(\"Failed to read saved model config: {error}\"))\n}\n\nfn subagents_status(app: &App) -> CommandResult {\n    let config = match load_command_config(app) {\n        Ok(config) => config,\n        Err(err) => return CommandResult::error(err),\n    };\n    let path = crate::config_persistence::config_toml_path(app.config_path.as_deref())\n        .map(|path| path.display().to_string())\n        .unwrap_or_else(|_| \"(unresolved)\".to_string());\n    let disabled_reason = config.subagents_disabled_reason();","sourceCodeStart":1420,"sourceCodeEnd":1456,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/commands/groups/config/config.rs#L1420-L1456","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Inspect profiles/route pins in config for entries shadowing Deepseek","Remove or correct the shadowing pin with the config command","Re-save the Deepseek default model so the identity resolves to Deepseek","Use the profile that actually owns the setting"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before showing the setting, verify the pin resolves to the same provider\nlet identity = config.resolve_provider_pin_identity(\"deepseek\")?;\nassert_eq!(identity.provider, \"deepseek\", \"Deepseek pin is shadowed by another route\");","typeGuard":null,"tryCatchPattern":"match saved_deepseek_default_model(app) {\n    Err(e) if e.to_string().contains(\"shadowed by another route\") => {\n        open_route_settings_to_fix_pin();\n    }\n    other => other?,\n}","preventionTips":["Avoid hand-editing profile/route pins","Re-save provider defaults after route changes","Audit profiles for cross-provider shadows","Keep one owner per provider pin"],"tags":["config","routing","provider"],"backgroundTag":"conflicting-config-options","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}