Skip to content

Resolve and reopen comment threads - #16

Merged
lonetis merged 1 commit into
lonetis:mainfrom
JohannKaspar:wt/resolve-comments
Nov 24, 2026
Merged

lonetis merged 1 commit into
lonetis:mainfrom
JohannKaspar:wt/resolve-comments

Conversation

@JohannKaspar

Copy link
Copy Markdown
Contributor

Changes

  • Resolve and reopen comment threads. resolveComments(path, threadIds) and reopenComments(path, threadIds) (SDK) call Overleaf's POST /project/:id/doc/:docId/thread/:threadId/resolve and .../reopen, the requests the review panel sends. The routes are doc-scoped. The older project-level /project/:id/thread/:threadId/resolve returns 404 on overleaf.com, which is why CLAUDE.md said these routes were missing.
  • Before sending, the ids are checked against the doc's anchored comments. If any id is not a comment in that doc, nothing is changed. Threads already in the wanted state are skipped. There is one request per thread, so if a later one fails, the error names the threads already changed.
  • MCP: new tools overleaf_resolve_comments and overleaf_reopen_comments {project, path, threadIds}, marked destructiveHint: false and idempotentHint: true (reversible). The resolve description tells the agent to close only threads the user asked to close.
  • CLI: resolve <project> <path> <threadId>... and reopen .... comments now prints each thread id, which these commands need.
  • Docs: README and CLAUDE.md updated, and the "routes return 404" note corrected. Deleting a thread is still not included.

Verified live

On a test project: resolve and reopen each return 204, and GET /project/:id/threads then reports resolved: true / false. The text and version do not change.

Tests

  • Unit tests: resolve by id (duplicate ids collapsed, no op sent to the doc), reopen, skipping threads already in the wanted state, an id that is not a comment in the doc changes nothing, a failure part-way names the threads already resolved, and an empty list does nothing.
  • Live test: add a comment, resolve it, reopen it, resolve it again, checking listComments after each step.
  • Typecheck passes. The full suite passes against a dedicated test project (157 passed, 1 skipped: the compile break-and-restore test, which skips itself while that project's main.tex has pending tracked changes).

Overleaf's resolve/reopen routes are doc-scoped
(POST /project/:id/doc/:docId/thread/:threadId/resolve|reopen); the older
project-level route 404s, which is why only create + list shipped so far.

- SDK: resolveComments / reopenComments. They read the doc's comments first
  and change nothing if any id is not anchored there, skip threads already in
  the wanted state, and name the threads already changed if a later request
  fails.
- CLI: resolve / reopen; comments now prints thread ids.
- MCP: overleaf_resolve_comments / overleaf_reopen_comments (reversible,
  idempotent).
- Unit tests and a live integration test (resolve, reopen, resolve).
@lonetis
lonetis merged commit 1ddccb2 into lonetis:main Nov 24, 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