Repository navigation
Let edits inside one's own pending suggestions through; expose overwriteTrackedChanges in MCP - #13
Merged
Conversation
…ckedChanges in MCP The suggestion guard refused any edit touching a pending tracked change, including the signed-in user's own, so follow-up edits inside one's own unaccepted suggestions were impossible. Now only other authors' changes are protected: the user id comes from the project page's ol-user_id and changes with that user_id pass. Verified live that a tracked insert inside one's own tracked insertion extends it and a tracked delete shrinks it. Unknown user id or authorless changes stay protected. The MCP write tools take overwriteTrackedChanges, described as only for when the user explicitly said to override a co-author's suggestion.
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 #10. The suggestion guard refused every edit that touched a pending tracked change, including the signed-in user's own. So once you had made a suggestion, you couldn't keep working inside it (e.g. adding a figure to a new section you had suggested) until a co-author accepted it.
Changes
user_idis the signed-in user (foreignChangesintrackedChanges.ts). The user id is scraped from the project page'sol-user_idtogether with the CSRF token (RestClient.currentUserId); it is not part ofjoinProjectResponse, and it is only fetched when an edit actually touches something. A change without an author, or every change when the user id cannot be read, stays protected.overwriteTrackedChangesis now an optional param on the seven text-writing tools. Its description tells the agent to set it only when the user explicitly said to override a co-author's suggestion, never to get past a refusal on its own. The conflict error says the same.Verified live (premium account, test project)
ol-user_id, and it matches themetadata.user_idof one's own changes.Tests
New unit tests cover: touching only your own suggestion is allowed, touching a co-author's is refused, a mixed edit is refused and names only the co-author, an unknown user id is refused, and
overwriteTrackedChangeslets the edit through.foreignChangeshas its own tests. The full suite, including the live integration and MCP e2e tests against a dedicated test project, passes: 142 passed, 1 skipped.