{"record":{"id":"a910be1ac1bb868c","repo":"Hmbown/CodeWhale","slug":"custom-provider-id-cannot-be-empty","errorCode":null,"errorMessage":"custom provider id cannot be empty","messagePattern":"custom provider id cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":11007,"sourceCode":"        && identity.key.trim() == ApiProvider::Custom.as_str()\n        && identity.persisted_id().is_none();\n    if matches!(provider, ApiProvider::Deepseek | ApiProvider::DeepseekCN) {\n        return save_api_key(api_key);\n    }\n    if is_legacy_literal_custom {\n        return save_root_api_key_for_secret_slot(api_key, \"custom\", false);\n    }\n\n    let api_key = api_key.trim();\n    anyhow::ensure!(!api_key.is_empty(), \"Refusing to save an empty API key.\");\n\n    let config_path =\n        credential_config_path().context(\"Failed to resolve config path for provider API key.\")?;\n    ensure_parent_dir(&config_path)?;\n\n    let key_inside = if provider == ApiProvider::Custom {\n        let key = identity.key.trim();\n        anyhow::ensure!(!key.is_empty(), \"custom provider id cannot be empty\");\n        key\n    } else {\n        provider_config_key(provider).context(\"provider api key table\")?\n    };\n    // A legacy, manually-selected Kimi CLI import implicitly routed Moonshot\n    // traffic to Kimi Code. Once the user replaces that import with the\n    // supported API-key route, persist the endpoint before changing auth_mode\n    // so the key is not silently sent to the ordinary Moonshot endpoint.\n    // Respect an explicit user-owned endpoint.\n    let pin_kimi_code_base_url = provider == ApiProvider::Moonshot\n        && route_config\n            .provider_config_for(provider)\n            .is_some_and(|entry| {\n                provider_config_uses_kimi_imported_token(entry)\n                    && entry\n                        .base_url\n                        .as_deref()\n                        .is_none_or(|base_url| base_url.trim().is_empty())","sourceCodeStart":10989,"sourceCodeEnd":11025,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/config.rs#L10989-L11025","documentation":"Error \"custom provider id cannot be empty\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/config.rs:11007 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}