Without (issue, agent) coalescing, a single member comment that @mentions
the assignee was enqueueing two tasks with identical trigger_comment_id —
once via shouldEnqueueOnComment → EnqueueTaskForIssue and once via
enqueueMentionedAgentTasks → EnqueueTaskForMention. The same double-fire
hit plain replies that inherit the assignee mention from the thread root.
Add commentMentionsAssignee, which uses the shared
shouldInheritParentMentions logic to compute the same effective mention
set the @mention path will see. Extend the on_comment gate to skip when
that helper says the assignee will be triggered through the @mention
path. Net result: exactly one task per (comment, assignee), with the
trigger comment preserved.
TestOnCommentTriggerDecision updated to reflect the new contract; assignee
mention cases that used to assert the on_comment branch fires now assert
it skips (mention path covers them). New integration test
TestAssigneeMentionDoesNotDoubleEnqueue pins the end-to-end behavior.
Also softens the "ClaimAgentTask guarantees serial execution" wording in
the code and the RFC: it is a coordination-side property under the
current single-poller-per-runtime model, not a DB-level lock on
(issue, agent). FOR UPDATE SKIP LOCKED locks the row being claimed, not
the key.
Co-authored-by: multica-agent <github@multica.ai>
Each @mention or assignee comment now creates its own queued task instead
of folding into a single pending task per (issue, agent). The previous
HasPendingTaskForIssueAndAgent short-circuit in enqueueMentionedAgentTasks
and shouldEnqueueOnComment is gone; ClaimAgentTask already enforces
per-(issue, agent) serial execution at claim time, so multiple queued rows
drain one-by-one without overlap.
Why: see docs/rfcs/0001-mention-dedup-policy.md. Coalescing dropped the
trigger comment for every mention after the first, gave no UI feedback,
and collapsed distinct intents (different threads, different requests).
Drops the unused HasPendingTaskForIssue and HasPendingTaskForIssueAndAgent
queries and regenerates sqlc.
Adds TestRepeatedMentionsEnqueueSeparateTasks pinning the new contract:
two back-to-back @mentions queue two tasks with distinct trigger_comment_ids.
Co-authored-by: multica-agent <github@multica.ai>