Body @mentions invite once; comment and reply @mentions notify (#116) - #117
Merged
Merged
Conversation
A mention in the body is a pointer, not a notification. It fires one
`mention` event per document (`invite: true`), only while the agent is
not present and only if it has never been invited, stamped on
`roster.invited_at` so a restart, a split block, or an agent patch
cannot re-fire it. The per-block WeakMap dedupe is gone. Mentions in a
new comment (from its thread entry, with the inline `{>>…<<}` run
stripped from the body scan) and in replies notify every time.
`read_document` returns `mentions`, the blocks that name the caller.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
5 tasks
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.
Closes #116. Follows the analysis in #115.
What changes
inviteMentioned(replacingnotifyMentions) fires onementionevent per document, taggedinvite: true, only while the agent is not present (joined and not idle) and only ifroster.invited_atis null, then stamps it. TheWeakMapkeyed by live Yjs blocks is gone, so a DO restart, a paragraph split, a paste, or an agentpatchcannot re-fire a mention that is already in the text. Policy inapp/shared/mention-policy.ts.commentTextis scanned in the threads observer (it used to be skipped as "add"), and the inline{>>…<<}run is stripped from the body scan so the same comment is not counted twice. Replies were already handled there.read_documentreturnsmentions, the blocks that name the caller, so a present agent can find what it should look at without scanning the markdown./mcphelp andllms.txt, the plugin skill, the design doc, and CLAUDE.md describe the policy: body mentions point, comments summon.Tests
tests/unit/shared/mention-policy.test.tsforshouldInviteandstripCommentRuns.mentions; a human comment notifies every time and its inline run is not double counted; an agent'scommentnaming another agent notifies it with the actor. The webhook suspension test now re-mentions through a comment.setupin the events tests enrolls viaagentReadrather thanagentJoin, since a joined agent is present and is not invited.Full suite: everything passes except the three localStorage test files that CLAUDE.md documents as failing under Node 26 (this machine runs Node 26).
🤖 Generated with Claude Code