Repository navigation
Description
Background
DetectedLLMGatewayClients() (pkg/client/llm_gateway.go:284) requires both the client's settings directory to exist and, when LLMBinaryName is set, the binary to resolve via exec.LookPath (sharedCLIDetection, pkg/client/llm_gateway.go:323). This was introduced in #5070 to prevent false positives from stale settings directories (e.g. ~/.claude, ~/.gemini) left behind after uninstall.
LLMBinaryName is set for six clients (pkg/client/config.go): VSCode (code), VSCodeInsider (code-insiders), Cursor (cursor), ClaudeCode (claude), GeminiCli (gemini), Codex (codex).
Problem
For claude, gemini, and codex, the binary check is a reliable installed-vs-uninstalled signal because these are genuine CLI tools; the binary lands on $PATH automatically as part of normal installation (npm/installer script).
For VSCode, VSCodeInsider, and Cursor, the equivalent code/code-insiders/cursor binary is an optional shell integration that each app only installs on $PATH when the user explicitly runs "Shell Command: Install 'X' command" from the command palette. Most users never do this. As a result, thv llm setup <client> reports:
Error: client "cursor" is not installed or not detected
even when the editor is installed and in active use — while thv client (MCP registration, IsClientInstalled in pkg/client/discovery.go:110) correctly detects the same client via settings-directory-only, since that check predates and was never updated by #5070.
The two detection paths for the same client now disagree, which is confusing on its own even setting aside the false negative.
Options for a fix
- Drop
LLMBinaryNamefor the GUI editors (VSCode, VSCode Insiders, Cursor) and rely on settings-directory-only detection, matching whatIsClientInstalledalready does successfully for these same clients today. Reintroduces the stale-directory false-positive risk llm: strengthen tool detection with binary presence check #5070 was written to close, but only for these three, and that risk already exists and is accepted in the MCP detection path. - App-bundle/install-location detection for these three, similar to the existing
LLMInstalledDetectorhook used for Claude Desktop (pkg/client/config.go:298,:1049). Discussed and set aside for now — fragile and highly OS/install-variant-specific (per-user vs. system-wide installs on Windows, multiple Linux packaging formats, etc.). - Leave detection as-is, but make the failure actionable. When a client has
LLMBinaryNameset and its settings directory exists but the binary isn't on$PATH, surface a specific message pointing at the fix (e.g. "cursor is installed but its 'cursor' shell command isn't on $PATH — run 'Shell Command: Install cursor command' from Cursor's command palette, then retry") instead of the generic "not installed or not detected." Doesn't fix the false negative, but turns a dead end into a one-step fix, and is complementary to options 1/2 regardless of which is chosen.
Needs an engineering decision on which tradeoff(s) to take. Filed for visibility and to avoid the docs and code drifting further apart.
References
- Original binary-check requirement: llm: strengthen tool detection with binary presence check #5070
pkg/client/llm_gateway.go:282-296(DetectedLLMGatewayClients),:320-346(sharedCLIDetection)pkg/client/discovery.go:110-123(IsClientInstalled, the MCP-path detector that still works)pkg/client/config.go:485-521(Cursor'sclientAppConfigentry)
Activity
stantheman0128 commentedon Aug 25, 2026
I'd like to work on this.
On this Win11 box Cursor is installed (
%APPDATA%\Cursorand~/.cursorboth exist).cursoris also on PATH here, soLookPathdoes not show the false negative live. The split is still easy to pin in tests: settings dir present plus a missing binary makesDetectedLLMGatewayClientsomit the client whileIsClientInstalledis true.TestDetectedLLMGatewayClients_DirExistsButBinaryAbsentcurrently encodes that LLM-side miss.Proposal, if you want this shape:
LLMBinaryNameon VSCode / VSCode Insiders / Cursor) so LLM detection matches the MCP settings-dir check. Keep the binary check forclaude/gemini/codex.I will wait to be assigned before opening a PR.
amirejaz commentedon Sep 1, 2026
Hey @stantheman0128, I have assigned the issue to you. Feel free to submit the PR.
stantheman0128 commentedon Sep 1, 2026
Thanks. I'll open the PR on empty
LLMBinaryNamefor the three GUI editors, keeping the binary check for claude / gemini / codex.Detect GUI editors without a PATH binary (stacklok#6481)