Repository navigation
fix: a no-op repeat add is not a mutation; tidy OpenCode remove; Cursor scope hint - #972
Merged
Merged
Conversation
A repeated add or update re-runs prepared setup completion for Gemini project, OpenCode and Cursor project installs. OpenCode and Cursor rewrote their intact owned objects and reported a committed effect, and closing the completion's own native attempt marker counted as a lifecycle change that rewrote updated_at. The result was mutated=true and no_change=null although nothing changed. - Verify intact owned objects instead of rewriting them, through one shared check that Gemini already applied for project setups. - Report a written Cursor MCP approval as a native effect, so a real approval still counts as a change. - Close a bare attempt marker after an unchanged outcome without a new timestamp; the binding returns to its exact predecessor. - Report such a completion as no change for single and group targets. A completion that reaches Active or writes anything still reports a mutation.
Adding the first OpenCode MCP server creates the "mcp" collection when the config has none. Removing the last owned server left that object behind, empty and in the writer's own layout, so remove did not restore the config that preceded the add. A removal now also drops the collection, and the V2 "servers" object inside it, when it is empty and still has the exact layout the kernel writes for a collection it creates. Any other layout, including a user's own empty "mcp", is preserved. Other native config codecs are unchanged.
Cursor user scope installs the package for the Cursor editor, so a host with only cursor-agent fails with `target "cursor" was not detected` while doctor reports the agent surface as detected. The error now says that only cursor-agent was found and that `--scope project` installs project skills and MCP servers for it. Detection is unchanged; the agent surface id becomes one shared constant.
…arker Closing a bare native attempt marker without a new updated_at and without reporting a change is right only when the adapter wrote nothing. A committed effect over an unchanged lifecycle and ownership, such as a settled Claude project call or a written Cursor approval, also took that path, so refresh and resume lost the mutation and updated_at stayed stale. A committed effect now records both again; the unchanged repeat stays silent. The completion tests run with a moving clock, so a missing or an unwanted updated_at rewrite is visible, and cover a committed effect over the same lifecycle for single add, group add/update and refresh.
A user's own empty "mcp" written in exactly the writer's layout is pruned too, which is harmless because an empty collection configures no server. Removal restores the pre-add shape only for documents the writer did not otherwise reformat.
777genius
marked this pull request as ready for review
November 17, 2026 03:54
|
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. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
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. |
This was referenced Nov 17, 2026
777genius
added a commit
that referenced
this pull request
Nov 17, 2026
Preserve owner #972 no-op completion and native cleanup behavior while moving the exact Cursor scope/surface predicate out of generic CLI code. Add boundary cases without changing hint text, target eligibility, public contracts, lint budgets, or native ownership checks. The composed predecessor failed TestClientIDBudgetDoesNotGrow; the corrected tree passes domain/architecture and CLI hint regressions. Full lint, CLI recovery, vet, and generated checks pass. Local Core retains only the preceding 28 top-level / 46 total failure baseline; current-source hosted Core and native E2E remain required.
34 of 43 tasks
777genius
added a commit
that referenced
this pull request
Nov 17, 2026
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.
This was referenced Nov 17, 2026
This was referenced Nov 17, 2026
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.
Follow-up to #959, three small leftovers found by running the installer against real clients on Linux and macOS.
A repeated
addthat changes nothing no longer counts as a mutation. For OpenCode (user and project), Gemini project and Cursor project, a repeataddor anupdatewith no changes reportedmutated: true, nono_change, and printed "installed and verified" instead of "Already installed. No changes made.". Two things caused it: the attempt marker that the same command writes was cleared through a normal state update (newupdated_at,changed=true), and OpenCode and Cursor rewrote their own untouched config objects while completing the setup. Now the intact objects are only verified (one shared check, also used by Gemini), and a bare attempt marker is closed without a newupdated_atwhen the adapter reports no committed native effect. A committed effect, a move to active, a real write or an MCP approval still recordsupdated_atandmutated: true; attempts with a pending native intent keep the full path. Tests use a moving clock and cover both outcomes for add, refresh and grouped add and update; they fail without the change in each direction.OpenCode
removeno longer leaves an empty"mcp": {}. When removal empties themcpcollection (andserversfor the V2 format) that the installer created, it is removed again, so the config returns to what it was before the first add. The installer's own collection is recognised by the exact layout it writes, so a user's own empty"mcp":{}written in that same layout is also removed; that is harmless, since an empty collection means the same as no key. A differently formatted one is kept.Cursor user scope with only
cursor-agent. The "target cursor was not detected" error now says that user scope installs for the Cursor editor and suggests--scope projectforcursor-agent. Detection is unchanged.Checked with real OpenCode 1.19.4 (user and project) and Gemini 0.65.0 (project): a repeat add gives
mutated: false,no_change: trueand an unchanged state file; after a repair that really restores a removed entry it reportsmutated: true. Tests of the touched packages pass and lint (changed lines plus size gate) is clean.Not covered: the OpenCode namespace collision check no longer runs on the intact repeat path, and Gemini and other formats keep an empty
mcpServersafterremove.