fix(client): detect Amp extension clients via amp.mcpServers key#5659
Open
syf2211 wants to merge 2 commits into
Open
fix(client): detect Amp extension clients via amp.mcpServers key#5659syf2211 wants to merge 2 commits into
syf2211 wants to merge 2 commits into
Conversation
Amp editor extensions (amp-vscode, amp-cursor, amp-windsurf) share the host editor's config directory, so checking only for directory presence incorrectly reports them as installed when VS Code, Cursor, or Windsurf is present without the Amp extension. Require the amp.mcpServers key in settings.json for these clients. Fixes stacklok#2174
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5659 +/- ##
==========================================
+ Coverage 70.33% 70.35% +0.01%
==========================================
Files 649 651 +2
Lines 66185 66304 +119
==========================================
+ Hits 46554 46647 +93
- Misses 16277 16295 +18
- Partials 3354 3362 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix false-positive "installed" status for Amp editor extensions (
amp-vscode,amp-cursor,amp-windsurf,amp-vscode-insider) inthv client status.Motivation
These Amp clients share the host editor's config directory (
Code/User,Cursor/User,Windsurf/User). Checking only for directory presence reports Amp as installed whenever VS Code, Cursor, or Windsurf is installed, even without the Amp extension.Fixes #2174
Changes
InstallSettingsKeytoclientAppConfigInstallSettingsKey: "amp.mcpServers"for Amp extension clients (notamp-cli, which has its own directory)IsClientInstalledto require the settings key when configured, usinghujson+gjsonwith dot escaping for dotted JSON keysTests
go test ./pkg/client/... -count=1All tests pass.
Notes
amp-cliis unchanged (dedicated~/.config/ampdirectory)amp.mcpServers: nullkey after uninstall could still report installed; acceptable edge case per maintainer guidance