From 651e5cef1ba1d6c6faa09da7d4dcdfc816399810 Mon Sep 17 00:00:00 2001 From: Bingsen Date: Fri, 15 May 2026 10:01:56 +0800 Subject: [PATCH] fix(tui): skip project-scope config merge when workspace is home directory When the workspace is the user's home directory, the project-scope config file (~/.deepseek/config.toml) is also the global config file. Skip the merge to avoid redundant processing and a misleading "project-scope config key ignored" warning on every launch from ~. Fixes the home-directory false-positive in the #417 deny-list check: the deny-list correctly refuses dangerous keys at project scope, but when cwd == $HOME the project file *is* the global file so the warning is noise. --- crates/tui/src/main.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/tui/src/main.rs b/crates/tui/src/main.rs index ee4874c0f..990cf5938 100644 --- a/crates/tui/src/main.rs +++ b/crates/tui/src/main.rs @@ -4159,6 +4159,20 @@ fn preserve_interrupted_checkpoint_for_explicit_resume(launch_workspace: &Path) /// Only explicitly set fields in the project file are applied; everything /// else falls back to the global value. fn merge_project_config(config: &mut Config, workspace: &Path) { + // When the workspace is the user's home directory, the project-scope + // config file is also the global config file. Skip the merge to avoid + // redundant processing and a misleading “project-scope config key + // ignored” warning on every launch from ~. + if let Some(home) = dirs::home_dir() + && let (Ok(w), Ok(h)) = ( + std::fs::canonicalize(workspace), + std::fs::canonicalize(&home), + ) + && w == h + { + return; + } + let path = workspace.join(".deepseek").join("config.toml"); let raw = match std::fs::read_to_string(&path) { Ok(r) => r,