Skip to content

Let edits inside one's own pending suggestions through; expose overwriteTrackedChanges in MCP - #13

Merged
lonetis merged 1 commit into
lonetis:mainfrom
JohannKaspar:wt/own-suggestions
Nov 19, 2026
Merged

lonetis merged 1 commit into
lonetis:mainfrom
JohannKaspar:wt/own-suggestions

Conversation

@JohannKaspar

@JohannKaspar JohannKaspar commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Only other authors' suggestions are protected. When an edit touches pending changes, the guard drops those whose user_id is the signed-in user (foreignChanges in trackedChanges.ts). The user id is scraped from the project page's ol-user_id together with the CSRF token (RestClient.currentUserId); it is not part of joinProjectResponse, 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.
  • MCP: overwriteTrackedChanges is 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.
  • When an edit touches both your own and a co-author's suggestion, it is still refused, and the error names only the co-author's changes.
  • Docs (CLAUDE.md, README, CLI help) updated.

Verified live (premium account, test project)

  • A tracked insert inside one's own tracked insertion extends it under the same change id, as in the web editor.
  • A tracked delete inside it just shrinks it (no deletion change is recorded).
  • An untracked insert inside it splits it into two suggestions around the plain text. This is allowed, because the suggestion is the user's own.
  • The project page carries ol-user_id, and it matches the metadata.user_id of 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 overwriteTrackedChanges lets the edit through. foreignChanges has its own tests. The full suite, including the live integration and MCP e2e tests against a dedicated test project, passes: 142 passed, 1 skipped.

…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.
@lonetis
lonetis merged commit 410a801 into lonetis:main Nov 19, 2026
1 check passed
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.

2 participants