From f9e682891262769bf221c0aa375d7ca11be5acbd Mon Sep 17 00:00:00 2001 From: Ben Gao Date: Tue, 13 Oct 2026 23:10:00 +0800 Subject: [PATCH] fix(config): write the provider-table api-key marker on a DeepSeek root key save A DeepSeek key saved through the TUI picker or onboarding goes through save_api_key -> save_root_api_key_for_secret_slot, which wrote the api-key marker only at the config root. Every other provider 's shared writer (prepare_provider_api_key_metadata) also writes [providers.] auth_mode, and that per-table marker is exactly what the non-active-provider secret-store read gate checks. So a saved DeepSeek key read back as missing as soon as another provider was the active one. Refs #6972 --- crates/tui/src/config.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/tui/src/config.rs b/crates/tui/src/config.rs index 89749cacd9..550c54c1e7 100644 --- a/crates/tui/src/config.rs +++ b/crates/tui/src/config.rs @@ -11554,6 +11554,11 @@ fn save_root_api_key_metadata_without_plaintext(config_path: &Path, table: &str) } crate::config_persistence::unset_document_value(doc, &["api_key"])?; crate::config_persistence::unset_document_value(doc, &["providers", table, "api_key"])?; + crate::config_persistence::set_document_value( + doc, + &["providers", table, "auth_mode"], + "api_key", + )?; if table == "deepseek" { crate::config_persistence::unset_document_value( doc,