Skip to content

fix(cursor): keep undetected scope diagnostics adapter-owned - #973

Closed
777genius wants to merge 2 commits into
mainfrom
fix/adapter-owned-cursor-detection-hint
Closed

777genius wants to merge 2 commits into
mainfrom
fix/adapter-owned-cursor-detection-hint

Conversation

@777genius

@777genius 777genius commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Cause and scope

Post-merge Required #44013458295 and Coverage #44013458136 on 9f29efca failed TestClientIDBudgetDoesNotGrow: #972 added a Cursor-specific client-ID branch to generic CLI preflight. This fix does not raise or weaken the architecture budget.

Current direct patch: four files, +54/−18, HEAD 295449c141f7d09725d59e5e29a89ed78ffcfe33.

  • Generic CLI resolves optional human-readable undetected-target guidance through the injected client registry, without branching on ClientCursor.
  • Cursor adapter provides UndetectedTargetHint for user scope when only cursor-agent is detected; project scope receives no user-scope hint.
  • Detector's raw ClientSurface evidence/golden identity and selection, trust and lifecycle behavior are unchanged. The earlier six-file draft was superseded after a real Core fast golden test failure.
  • Added user/project adapter tests while retaining CLI regression coverage.

Exact-HEAD qualification

Release gates

Remain Draft until an independent qualifying review is present, current HEAD/direct diff and applicable native gates are rechecked, and merge is authorized by repository rules. Current main has moved; original post-merge Required/Coverage failures remain real and are not repaired until this change lands. After any merge, verify fresh exact-source post-merge Required/Core/native/CodeQL E2E. No old failed job re-runs, manual protected publication or permission overrides.

Preserve the project-scope suggestion without client identity branching in generic CLI. Keep the hint private, observational and non-authoritative; add host-surface regression checks. Restore shrink-only archtest ratchet after #972.
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI now obtains undetected-target guidance through the client registry. The Cursor adapter provides a project-scope recommendation when cursor-agent is detected without cursor under user-scope selection.

Changes: Undetected-target guidance

Layer / File(s) Summary
Registry-based guidance
cli/internal/agentpluginscli/add_targets.go, cli/internal/agentpluginscli/preflight.go
Explicit-target selection now receives the app. Preflight resolves guidance through the client registry for the detected client.
Cursor guidance and tests
install/integrationctl/agentplugins/clients/cursor/detect.go, install/integrationctl/agentplugins/clients/cursor/detect_test.go
The Cursor adapter provides a project-scope recommendation when cursor-agent is detected without cursor under user-scope selection. Tests check that the project-scope adapter returns no hint.

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

Change: Bug fix

Merge Risk: Minimal · up to 29544

The change moves the Cursor scope hint from generic CLI preflight to the Cursor adapter. It has no identified merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description follows the repository template in structure but leaves most of it unverified. It states a cause and scope (post-merge Required and Coverage failures on TestClientIDBudgetDoesNotGrow a… Tick or annotate each Verification item with the result or reason it does not apply. Specifically, state whether go test ./..., make lint, make vet, and make generated-check were run at the exact HEAD, and confirm that focused tests were ad…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the Cursor adapter and the scope diagnostic move. The change moves the undetected-scope hint from generic CLI preflight into the Cursor detection adapter, so the title matches the main…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the Cursor adapter and the scope diagnostic move. The change moves the undetected-scope hint from generic CLI preflight into the Cursor detection adapter, so the title matches the main change. It is short and specific, and it follows the repository's conventional-commit style.

Full details: Description check

Explanation

The description follows the repository template in structure but leaves most of it unverified. It states a cause and scope (post-merge Required and Coverage failures on TestClientIDBudgetDoesNotGrow after PR #972) and lists the four-file direct patch and its behavior. It also gives exact-HEAD CI results. However, the Verification checklist is unchecked, including go test, make lint, make vet, make generated-check, and the focused-test item, even though the author reports Core fast and other workflows as passing. The Release Impact checklist is also unchecked. The description says the PR remains Draft pending independent review, which is consistent with the template but leaves release impact undecided. The description also gives a different file count (four files) than the objectives (six-file direct diff), which the author should reconcile.

Resolution

Tick or annotate each Verification item with the result or reason it does not apply. Specifically, state whether go test ./..., make lint, make vet, and make generated-check were run at the exact HEAD, and confirm that focused tests were added or updated. Complete the Release Impact section by checking the applicable boxes, such as no public contract change, and stating whether docs were updated and whether release-sensitive paths were reviewed. Reconcile the four-file patch count in the description with the six-file direct diff cited in the PR objectives.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9f29efc and 295449c.

Files selected for processing: 4

  • cli/internal/agentpluginscli/add_targets.go
  • cli/internal/agentpluginscli/preflight.go
  • install/integrationctl/agentplugins/clients/cursor/detect.go
  • install/integrationctl/agentplugins/clients/cursor/detect_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Copy link
Copy Markdown
Owner Author

Reconciled against current main (d933508885e57d5dcdd0c4e5c17ff76d4cf52a76). This patch is now superseded by already-merged #980 (commit 6a63114be6e7050ca398ab87efcb24e994d2f3be), not an outstanding Cursor defect.

The merged implementation is adapter-owned without a Cursor-specific generic CLI branch: cursor.Adapter.agentOnlyHint supplies Detection.NotDetectedHint, detector passes it to DetectedClient.NotDetectedHint only for an undetected target, and CLI renders it through generic undetectedTargetHint. It covers user-scope agent-only diagnostic, silent project scope, unchanged raw surface identity, and selector behavior. Existing TestAgentOnlyHintIsUserScopeOnly, project registry tests and CLI hint tests cover these semantics. #980 avoids an additional registry lookup and extra adapter interface proposed in this older draft.

Do not merge the stale draft: GitHub currently reports mergeable_state=dirty; resolving it by replacing newer paths would regress the shipped solution. Closing as superseded, with no loss of functional scope. No green skipped checks are being counted as executed E2E.

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