{"record":{"id":"377ea16e09714b80","repo":"Hmbown/CodeWhale","slug":"deepseek-uses-the-root-base-url-setting","errorCode":null,"errorMessage":"DeepSeek uses the root base_url setting","messagePattern":"DeepSeek uses the root base_url setting","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config_persistence.rs","lineNumber":576,"sourceCode":"/// named custom routes use their exact user-owned table id. Only a legacy\n/// literal custom route retains its root model field.\npub(crate) fn persist_provider_model_key(\n    config_path: Option<&Path>,\n    provider: ApiProvider,\n    provider_identity: &str,\n    value: &str,\n) -> anyhow::Result<PathBuf> {\n    let path = config_toml_path(config_path)?;\n    mutate_config_document(&path, |doc| {\n        set_provider_model_document(doc, provider, provider_identity, value)\n    })?;\n    Ok(path)\n}\n\nfn provider_base_url_table_key(provider: ApiProvider) -> anyhow::Result<&'static str> {\n    match provider {\n        ApiProvider::Deepseek | ApiProvider::DeepseekCN => {\n            anyhow::bail!(\"DeepSeek uses the root base_url setting\")\n        }\n        ApiProvider::DeepseekAnthropic => Ok(\"deepseek_anthropic\"),\n        ApiProvider::NvidiaNim => Ok(\"nvidia_nim\"),\n        ApiProvider::Openai => Ok(\"openai\"),\n        ApiProvider::Anthropic => Ok(\"anthropic\"),\n        ApiProvider::Atlascloud => Ok(\"atlascloud\"),\n        ApiProvider::WanjieArk => Ok(\"wanjie_ark\"),\n        ApiProvider::Volcengine => Ok(\"volcengine\"),\n        ApiProvider::Openrouter => Ok(\"openrouter\"),\n        ApiProvider::Orcarouter => Ok(\"orcarouter\"),\n        ApiProvider::XiaomiMimo => Ok(\"xiaomi_mimo\"),\n        ApiProvider::Novita => Ok(\"novita\"),\n        ApiProvider::Fireworks => Ok(\"fireworks\"),\n        ApiProvider::Siliconflow | ApiProvider::SiliconflowCn => Ok(\"siliconflow\"),\n        ApiProvider::Arcee => Ok(\"arcee\"),\n        ApiProvider::Huggingface => Ok(\"huggingface\"),\n        ApiProvider::Modelscope => Ok(\"modelscope\"),\n        ApiProvider::Deepinfra => Ok(\"deepinfra\"),","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config_persistence.rs#L558-L594","documentation":"provider_base_url_table_key maps an ApiProvider to its per-provider config table key. DeepSeek and DeepSeekCN are deliberately excluded: their base_url lives in the root config's base_url setting, not a named table, so calling this with either variant bails instead of persisting to the wrong place.","triggerScenarios":"Calling persist_provider_base_url_key (via provider_base_url_table_key) with ApiProvider::Deepseek or ApiProvider::DeepseekCN to persist a provider-specific base_url.","commonSituations":"A settings UI or automation writes a base_url override for the DeepSeek provider through the generic per-provider persistence path instead of updating the root base_url setting.","solutions":["Update the root base_url config setting instead of the per-provider table for DeepSeek/DeepSeekCN.","Route DeepSeek base_url persistence through the code path that writes the root setting.","If you need a DeepSeek base_url different from the root setting, use a different provider entry (e.g. a custom provider)."],"exampleFix":"// before\npersist_provider_base_url_key(config_path, ApiProvider::Deepseek, &url)?;\n// after\npersist_root_base_url(config_path, &url)?;","handlingStrategy":"validation","validationCode":"fn is_deepseek(p: ApiProvider) -> bool { matches!(p, ApiProvider::Deepseek | ApiProvider::DeepseekCN) }\nif is_deepseek(provider) { /* write root base_url instead */ }","typeGuard":"fn uses_per_provider_table(p: ApiProvider) -> bool { !matches!(p, ApiProvider::Deepseek | ApiProvider::DeepseekCN) }","tryCatchPattern":"match persist_provider_base_url_key(path, provider, &url) {\n    Err(e) if e.to_string().contains(\"root base_url\") => persist_root_base_url(path, &url),\n    other => other,\n}","preventionTips":["Treat DeepSeek base_url as a root-level setting in all tooling.","Check the provider variant before choosing a persistence path.","Keep a mapping table of provider -> base_url location in your automation."],"tags":["config","provider","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}