Repository navigation
Fix Claude Desktop paths and managed check on Linux - #6883
Conversation
Claude Desktop's configLibrary and user-data directories live under ~/.config on Linux, but the client entry only set prefixes for macOS and Windows, so setup never detected Desktop and wrote config it never reads. Add the Linux prefix, and detect the Linux managed settings file (/etc/claude-desktop/managed-settings.json) in IsManaged so setup and connector add warn when it overrides the local config. Fixes #6847 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Existing Linux E2E fixtures still use the old paths, causing both Claude Desktop specs to fail installation detection.
1 open issue
What changed in this PR
Fixes Claude Desktop’s Linux configuration paths and adds managed-settings detection to ToolHive’s setup and connector workflows.
Changes:
- Add
.configprefixes for Linux configuration and installation detection. - Detect Linux managed settings and use platform-neutral warnings.
- Expand regression tests and update connector help.
| File | Description |
|---|---|
pkg/llm/setup.go |
Update managed-configuration warning wording. |
pkg/llm/setup_test.go |
Match the revised warning. |
pkg/client/llm_gateway.go |
Pass client configuration to managed-source detection. |
pkg/client/llm_gateway_credential_helper.go |
Detect regular Linux managed-settings files. |
pkg/client/llm_gateway_credential_helper_test.go |
Cover platform paths and managed-file detection; repair guard fixture. |
pkg/client/config.go |
Correct Linux paths and declare managed-settings location. |
pkg/client/claude_desktop_connectors.go |
Update connector warning wording. |
pkg/client/claude_desktop_connectors_test.go |
Exercise Linux managed-configuration warnings. |
docs/cli/thv_client_connector_add.md |
Document Linux managed settings. |
cmd/thv/app/client_connector.go |
Update connector command help. |
Review effort: Balanced
The fixture encoded the old Linux paths without the ~/.config prefix, so the Claude Desktop specs would fail installation detection. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6883 +/- ##
==========================================
+ Coverage 79.76% 79.79% +0.03%
==========================================
Files 825 827 +2
Lines 84263 84553 +290
==========================================
+ Hits 67212 67470 +258
- Misses 17046 17078 +32
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aponcedeleonch
left a comment
There was a problem hiding this comment.
The path fixes look right to me. They match the configuration reference for configLibrary, the user-data dir, and the managed file location on all three platforms.
My only comment is on the symlink handling in managedSettingsFileExistsUnder. The docs say a managed file that fails the checks (symlink, wrong owner, group/world-writable) is rejected, but the app then "treats the device as managed but unreadable, and local settings are also disabled". So a symlinked file still means Desktop won't read what thv writes, and today we'd skip the warning in exactly that case. I think we should count any entry at that path as managed. That also means skipping the ownership checks is fine, though not because of the false-positive reasoning in the notes. Ideally the warning for an invalid file would say to fix it rather than "add it to the managed configuration instead".
Claude Desktop rejects a managed settings file that is a symlink, not owned by root, or group- or world-writable, but still treats the device as managed and disables local settings. The local config ToolHive writes is ignored either way, so count any entry at the path as managed instead of only a regular file. The warnings now also say to fix the managed configuration if Desktop rejected it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@aponcedeleonch Agreed, thanks. Any entry at that path now counts as managed, and the warnings also say to fix the managed configuration if Desktop rejected it. Updated the reviewer notes to match. Fixed in e1a8b1d. |

Summary
On Linux, ToolHive looked for Claude Desktop in the wrong places. The Claude Desktop entry set path prefixes only for macOS and Windows, so on Linux both paths were joined directly under the home directory:
~/Claude-3p/configLibrary/instead of~/.config/Claude-3p/configLibrary/, and~/Claudeinstead of~/.config/Claude. As a result,thv llm setupnever detected an installed Claude Desktop. With--client claude-desktopit wrote a config Desktop never reads, andthv client connector add|list|rmhad the same problem. The check for a managed configuration was also macOS-only, so on Linux nothing warned that/etc/claude-desktop/managed-settings.jsonoverrides the local config..configLinux prefix to Claude Desktop's configLibrary and detection paths, matching the Claude Desktop configuration reference and the other clients inconfig.go.IsManagedcheck/etc/claude-desktop/managed-settings.jsonon Linux. Any entry at that path counts, including one Desktop rejects. The existingthv llm setupandthv client connector addwarnings now fire on Linux.TestRevertCredentialHelper_RejectsUnsafeConfigPath, which hardcoded the macOS path. On Linux it created the wrong directory and passed without reaching the guard it tests.Fixes #6847
Type of change
Test plan
task test)task test-e2e)task lint-fix)The new
TestClaudeDesktopPathsResolvePerPlatformreads the prefix maps for every platform rather than onlyruntime.GOOS. It failed on macOS for thelinuxcase before the fix, so the gap is caught on any runner, not just Linux CI.TestAddConnector_WarnsWhenDesktopWillNotLoadItno longer skips the managed case outside macOS, so Linux CI now exercises the Linux managed-file check. Not tested against a real Claude Desktop install on Linux.Does this introduce a user-facing change?
Yes, on Linux only:
thv llm setupdid not detect Claude Desktop.--client claude-desktopandthv client connector add|list|rm --client claude-desktopread and wrote~/Claude-3p/configLibrary/, which Desktop ignores. No warning when/etc/claude-desktop/managed-settings.jsonis present.~/.config/Claude, its configuration is written to~/.config/Claude-3p/configLibrary/, and both commands warn when the managed settings file is present.Any configuration a Linux user previously wrote to
~/Claude-3p/is left in place and not migrated. Desktop never read it, so nothing that worked before stops working.On macOS, the setup and connector warnings now say "managed configuration" instead of "managed-preferences profile". Detection on macOS is unchanged.
Special notes for reviewers
/etc) plus a relative path on the client entry. This mirrors the existing macOSmanagedPreferencesRootandLLMManagedProfileDomainpair, so tests can redirect it.config.go: if$XDG_CONFIG_HOMEis set, Electron uses it instead of~/.config. That's better handled for all clients in a separate change.Found by @aponcedeleonch in review of #6840.
🤖 Generated with Claude Code