Skip to content

thv llm setup false-negative detection for Cursor/VSCode without shell PATH integration #6292

Closed

Description

@danbarr

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

  1. Drop LLMBinaryName for the GUI editors (VSCode, VSCode Insiders, Cursor) and rely on settings-directory-only detection, matching what IsClientInstalled already 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.
  2. App-bundle/install-location detection for these three, similar to the existing LLMInstalledDetector hook 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.).
  3. Leave detection as-is, but make the failure actionable. When a client has LLMBinaryName set 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's clientAppConfig entry)

Activity

  1. added
    needs-triage
    on Aug 12, 2026
  2. stantheman0128 commented on Aug 25, 2026

    @stantheman0128
    Contributor

    I'd like to work on this.

    On this Win11 box Cursor is installed (%APPDATA%\Cursor and ~/.cursor both exist). cursor is also on PATH here, so LookPath does not show the false negative live. The split is still easy to pin in tests: settings dir present plus a missing binary makes DetectedLLMGatewayClients omit the client while IsClientInstalled is true. TestDetectedLLMGatewayClients_DirExistsButBinaryAbsent currently encodes that LLM-side miss.

    Proposal, if you want this shape:

    1. Option 1 for the three GUI editors (empty LLMBinaryName on VSCode / VSCode Insiders / Cursor) so LLM detection matches the MCP settings-dir check. Keep the binary check for claude / gemini / codex.
    2. Option 3 as a complementary error when a CLI client's dir exists and the binary does not, instead of the generic "not installed or not detected".

    I will wait to be assigned before opening a PR.

  3. removed
    needs-triage
    on Sep 1, 2026
  4. amirejaz commented on Sep 1, 2026

    @amirejaz
    Contributor

    Hey @stantheman0128, I have assigned the issue to you. Feel free to submit the PR.

  5. stantheman0128 commented on Sep 1, 2026

    @stantheman0128
    Contributor

    Thanks. I'll open the PR on empty LLMBinaryName for the three GUI editors, keeping the binary check for claude / gemini / codex.

  6. added a commit that references this issue on Sep 2, 2026
    d859bfe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions