Skip to content

fix(cli): let the Cursor adapter explain the agent-only user scope - #980

Merged
777genius merged 2 commits into
mainfrom
fix/cursor-scope-hint-from-adapter
Nov 17, 2026
Merged

777genius merged 2 commits into
mainfrom
fix/cursor-scope-hint-from-adapter

Conversation

@777genius

@777genius 777genius commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Required has been red on main since #972: TestClientIDBudgetDoesNotGrow rejects the new Cursor identity branch in cli/internal/agentpluginscli/preflight.go.

The hint now comes from the Cursor detector (Detection.NotDetectedHint -> DetectedClient.NotDetectedHint, shown only when the client ends up not detected). The CLI prints it and no longer knows about Cursor.

Checked locally: archtest, cursor, clientdetect (goldens gain an empty NotDetectedHint field), the CLI package, golangci-lint on changed lines.

Summary by CodeRabbit

  • Bug Fixes
    • Improved guidance when Cursor is not available for the selected installation scope. If only the Cursor command-line agent is detected, the message explains that user-scope installation requires the Cursor editor and points to project scope for project skills and MCP servers.
    • Hints now appear only when Cursor is not detected as selectable, avoiding unnecessary guidance when the editor is available or project scope is selected.

The generic CLI branched on the Cursor client identity to hint at --scope
project, which the client-identity budget rejects and which turned Required
red on main. The Cursor detector now supplies the hint and the CLI only
shows it.
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The change moves Cursor’s user-scope guidance into client detection. The detector carries that guidance only for clients that are not detected, and the CLI uses the selected client’s hint in undetected-target errors.

Changes: Undetected client hints

Layer / File(s) Summary
Hint contract and Cursor guidance
install/integrationctl/agentplugins/clients/detection.go, install/integrationctl/agentplugins/domain/clients_runtime.go, install/integrationctl/agentplugins/clients/cursor/detect.go, install/integrationctl/agentplugins/clients/cursor/detect_test.go
Detection types carry NotDetectedHint. Cursor detection supplies user-scope guidance when only the Cursor agent surface is detected; tests cover project scope and editor-surface cases.
Detection hint propagation
install/integrationctl/agentplugins/adapters/clientdetect/detector.go, install/integrationctl/agentplugins/adapters/clientdetect/cursor_project_registry_test.go, install/integrationctl/agentplugins/adapters/clientdetect/testdata/golden/detect_*.json
The detector copies the hint only when the client is not detected. Registry tests check scope behavior, and platform fixtures add empty hint fields.
CLI hint display
cli/internal/agentpluginscli/add_targets.go, cli/internal/agentpluginscli/preflight.go, cli/internal/agentpluginscli/undetected_target_hint_test.go
Undetected-target errors use the selected client’s hint. CLI selection no longer passes install scope to generate a Cursor-specific message.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Possibly related PRs

Merge Risk: Minimal · up to 7b58b

This change moves the Cursor user-scope guidance into the Cursor detector. The CLI only prints the hint when the target client is not detected. No concrete merge-blocking risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

selectExplicitClient no longer takes the scope it stopped using.
@777genius
777genius marked this pull request as ready for review November 17, 2026 13:44
@strix-security

Copy link
Copy Markdown

Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here.

So far, Strix has reviewed 392 pull requests, surfaced 113 security issues (1 critical/high) and blocked 3 risky merges across this workspace.

@777genius
777genius merged commit 6a63114 into main Nov 17, 2026
56 of 89 checks passed
@777genius
777genius deleted the fix/cursor-scope-hint-from-adapter branch November 17, 2026 13:44
@codecov

codecov Bot commented Nov 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.14%. Comparing base (726899a) to head (7b58b78).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
cli/internal/agentpluginscli/add_targets.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #980      +/-   ##
==========================================
+ Coverage   63.09%   63.14%   +0.05%     
==========================================
  Files        2254     2264      +10     
  Lines      135180   135721     +541     
==========================================
+ Hits        85294    85704     +410     
- Misses      37525    37610      +85     
- Partials    12361    12407      +46     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant