Skip to content

fix(tui): skip project-scope config merge when workspace is home directory#1664

Closed
Lellansin wants to merge 1 commit into
Hmbown:mainfrom
Lellansin:fix/home-dir-project-scope-warning
Closed

fix(tui): skip project-scope config merge when workspace is home directory#1664
Lellansin wants to merge 1 commit into
Hmbown:mainfrom
Lellansin:fix/home-dir-project-scope-warning

Conversation

@Lellansin
Copy link
Copy Markdown

@Lellansin Lellansin commented May 15, 2026

Summary

  • skip project-scope config merge when the workspace root resolves to the user home directory
  • when cwd == $HOME, the project file (~/.deepseek/config.toml) is also the global config file — merge is redundant and the warning is noise
  • guard early in merge_project_config via dirs::home_dir() + std::fs::canonicalize

The #417 deny-list correctly refuses dangerous keys at project scope, but the warning fires even when the project file is the same file as the global config.

Tests

  • cargo fmt --all -- --check
  • cargo check -p deepseek-tui --locked
  • cargo clippy -p deepseek-tui --all-targets --all-features --locked -- -D warnings
  • cargo test -p deepseek-tui -- merge_project_config project_overlay --locked (15/15 passed)
  • git diff --check

Reproduce (main)

tmux -S /tmp/claude.sock new -d -s repro -n shell
tmux -S /tmp/claude.sock send-keys -t repro:1.1 -- \
  'cd ~ && deepseek-tui 2>/tmp/repro.log' Enter
sleep 4
tmux -S /tmp/claude.sock send-keys -t repro:1.1 C-c  # first Ctrl+C
sleep 1
tmux -S /tmp/claude.sock send-keys -t repro:1.1 C-c  # second Ctrl+C
sleep 2
cat /tmp/repro.log
# Output: warning: project-scope config key `api_key` is ignored …

Verify (this branch)

Same steps produce no project-scope config key … ignored warning.

Environment: macOS, ~/.deepseek/config.toml contains api_key. TUI started from ~.

…ctory

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 Hmbown#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.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@Hmbown
Copy link
Copy Markdown
Owner

Hmbown commented May 23, 2026

This PR was opened before the v0.8.41 rebrand and is now stale. Feel free to rebase onto current main and reopen. 鲸鱼兄弟们等你 🐋

@Lellansin
Copy link
Copy Markdown
Author

Rebased and force-pushed the branch to current main. GitHub refuses to reopen this PR because the branch was force-pushed/recreated, so I opened replacement PR #2055.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants