mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
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>