Skip to content

fix: mark the thread or conversation read when replying - #144

Merged
scottlovegrove merged 2 commits into
mainfrom
scottl/reply-mark-read
Dec 4, 2026
Merged

scottlovegrove merged 2 commits into
mainfrom
scottl/reply-mark-read

Conversation

@scottlovegrove

@scottlovegrove scottlovegrove commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

The CLI counterpart of todoist/comms-mcp#133 (todoist/comms-mcp#132).

When you post in Comms, the backend skips you when it marks the thread or conversation unread, but it never clears unread you already had. So replying with tdc thread reply left the thread unread until a separate tdc thread mark-read, and replying with tdc conversation reply left the conversation unread with no way to clear it from the CLI at all, since nothing here calls conversations.markRead.

Both reply commands now mark the target read through the reply they just posted: a thread with threads.markRead({ id, objIndex }) using the new comment's objIndex (--close and --reopen included), a conversation with conversations.markRead({ id, messageId }) using the new message's ID. The backend treats a position below the latest one as moving the unread marker forward, so anything posted after the reply stays unread. A reply that fails to post, and a --dry-run, mark nothing; the dry-run preview has a Mark read: yes (or no) line saying what a real run would do.

--no-mark-read on both commands turns it off. It is named after the existing tdc thread mark-read verb rather than the MCP's markAsRead parameter. If the reply posts but marking it read fails, the command still prints the posted reply and exits 0, with a Warning: line on stderr (and, for threads, the tdc thread mark-read command to run), following the unarchive warning in thread create. Failing the command would read to a script as a failed post and invite a second one. --json output is unchanged.

SKILL_CONTENT, skills/comms-cli/SKILL.md, docs/SPEC.md and the spinner map cover the new flag and SDK call. Not tried against the real Comms API; covered by tests against the mocked client.

Comms never moves the poster's own read position when they post, so a
reply to an unread thread or conversation left it unread: threads until
a separate `tdc thread mark-read`, conversations until opened in the
app, since the CLI has no way to mark one read.

`tdc thread reply` and `tdc conversation reply` now mark the target read
through the reply they posted: a thread by the new comment's objIndex
(--close and --reopen included), a conversation by the new message's ID.
Anything posted after the reply stays unread. --no-mark-read turns it
off. When the reply posts but marking it read fails, the command still
succeeds and warns on stderr, so a script does not post it again.
@scottlovegrove scottlovegrove self-assigned this Dec 4, 2026

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both tdc thread reply and tdc conversation reply now mark the target read through the reply they just posted (using the new comment's objIndex or the new message's ID), with a --no-mark-read opt-out, and the marking is skipped on --dry-run and when the post fails. No inline issues were flagged — the implementation reuses the existing spinner, permissions, and warning-on-failure patterns, keeps docs, skill content, and the spinner map in sync, and the new tests cover the default behavior, opt-out, dry run, post failure, and the non-fatal warning path.

I also left one optional follow-up note in the details below.

Optional follow-up note (1)
  • P3 src/commands/thread/reply.ts:182: The --dry-run preview only names the explicit --close/--reopen action (post comment to thread and close it) and the notify defaults, so it doesn't show the new default mark-read side effect a real run performs. tdc thread reply <ref> "x" --dry-run currently reads as if only the comment is posted. Consider appending and mark it read (and the conversation equivalent in src/commands/conversation/reply.ts) to the dry-run label/fields when options.markRead !== false, so the preview matches the documented default: https://handbook.doist.com/doc/github-repository-guidelines-iJNZ0D2vLN

Share Feedback • Review Logs • Trace

@scottlovegrove
scottlovegrove added this pull request to stack #146 December 4, 2026 14:34
@scottlovegrove scottlovegrove added the 👀 Show PR requires passing checks before merge and independent human review before or after merge. label Dec 4, 2026
@scottlovegrove
scottlovegrove merged commit e061f51 into main Dec 4, 2026
5 checks passed
@scottlovegrove
scottlovegrove deleted the scottl/reply-mark-read branch December 4, 2026 15:04
doist-release-bot Bot added a commit that referenced this pull request Dec 4, 2026
## [6.1.0](v6.0.1...v6.1.0) (2026-12-04)

### Features

* **conversation:** add tdc conversation mark-read ([#147](#147)) ([bda7dcf](bda7dcf))
* **conversation:** add tdc conversation mark-unread ([#148](#148)) ([c9c02e8](c9c02e8))

### Bug Fixes

* mark the thread or conversation read when replying ([#144](#144)) ([e061f51](e061f51))
@doist-release-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 6.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR requires passing checks before merge and independent human review before or after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants