Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(server): keep squad leader fallback for agent comments that mention people (MUL-9436) (#10760)
Akkiaf1e2dbe3a3a3
diff --git a/apps/docs/content/docs/comments.fr.mdx b/apps/docs/content/docs/comments.fr.mdxindex 65b62a7c58..a2f7dace65 100644--- a/apps/docs/content/docs/comments.fr.mdx+++ b/apps/docs/content/docs/comments.fr.mdx@@ -99,7 +99,7 @@ Tapez `@` et choisissez une cible dans la liste :| **Squad** | Déclenche le chef du squad ; les membres du squad ne sont pas notifiés. || **Tâche** | Insère un lien vers une autre tâche — aucune notification, aucun déclenchement d'agent. || **Projet** | Insère un lien vers un projet — aucune notification, aucun déclenchement d'agent. |-| **@all** | Notifie tous les membres de l'espace de travail et ne déclenche aucun agent. |+| **@all** | Notifie tous les membres de l'espace de travail ; la mention elle-même ne lance aucun agent. Le commentaire d'un agent worker revient toujours au chef du squad assigné, ou au chef du squad invité dans son fil de délégation, sauf si un agent ou un squad est explicitement mentionné. |Taper `@name` en texte brut ne crée pas de mention ; choisissez dans la liste de suggestions de l'éditeur. Taper un identifiant de tâche valide le convertit automatiquement en lien vers la tâche.diff --git a/apps/docs/content/docs/comments.ja.mdx b/apps/docs/content/docs/comments.ja.mdxindex d85eb7b3ab..b16398b801 100644--- a/apps/docs/content/docs/comments.ja.mdx+++ b/apps/docs/content/docs/comments.ja.mdx@@ -99,7 +99,7 @@ Web と Desktop では、投稿済みのコメント(自分のコメントを| **スクワッド** | スクワッドのリーダーをトリガーします。スクワッドのメンバーには通知されません。 || **タスク** | 別のタスクへのリンクを挿入します。通知もエージェントのトリガーもありません。 || **プロジェクト** | プロジェクトへのリンクを挿入します。通知もエージェントのトリガーもありません。 |-| **@all** | すべてのワークスペースメンバーに通知し、どのエージェントもトリガーしません。 |+| **@all** | すべてのワークスペースメンバーに通知します。メンション自体はエージェントを起動しません。ワーカーエージェントのコメントは、エージェントやスクワッドへの明示的なメンションがなければ、割り当て先スクワッドのリーダー、または委任スレッドのゲストスクワッドのリーダーに戻ります。 |プレーンテキストで `@name` と入力してもメンションにはなりません。エディターの候補リストから選択してください。有効なタスクキーを入力すると、エディターが自動的にタスクリンクへ変換します。diff --git a/apps/docs/content/docs/comments.ko.mdx b/apps/docs/content/docs/comments.ko.mdxindex 3f659b88b7..4420ae55a1 100644--- a/apps/docs/content/docs/comments.ko.mdx+++ b/apps/docs/content/docs/comments.ko.mdx@@ -99,7 +99,7 @@ Web과 Desktop에서는 게시된 댓글(본인 댓글 포함)의 텍스트를| **스쿼드** | 스쿼드 리더의 실행을 트리거합니다. 스쿼드 멤버에게는 알림이 가지 않습니다. || **태스크** | 다른 태스크의 링크를 삽입합니다. 알림을 보내거나 에이전트를 트리거하지 않습니다. || **프로젝트** | 프로젝트 링크를 삽입합니다. 알림을 보내거나 에이전트를 트리거하지 않습니다. |-| **@all** | 워크스페이스의 모든 멤버에게 알립니다. 에이전트는 트리거하지 않습니다. |+| **@all** | 워크스페이스의 모든 멤버에게 알리며, 멘션 자체는 에이전트를 시작하지 않습니다. 에이전트나 스쿼드를 명시적으로 멘션하지 않으면 워커 에이전트의 댓글은 할당된 스쿼드 리더 또는 위임 스레드의 게스트 스쿼드 리더에게 돌아갑니다. |일반 텍스트로 `@name`을 직접 입력하면 멘션이 만들어지지 않습니다. 편집기의 후보 목록에서 선택해야 합니다. 유효한 태스크 번호를 입력하면 편집기가 자동으로 태스크 링크로 변환합니다.diff --git a/apps/docs/content/docs/comments.mdx b/apps/docs/content/docs/comments.mdxindex 24651e8ad3..e649334a6e 100644--- a/apps/docs/content/docs/comments.mdx+++ b/apps/docs/content/docs/comments.mdx@@ -99,7 +99,7 @@ Type `@` and pick a target from the list:| **Squad** | Triggers the squad leader; squad members are not notified. || **Issue** | Inserts a link to another issue — no notification, no agent trigger. || **Project** | Inserts a link to a project — no notification, no agent trigger. |-| **@all** | Notifies every workspace member and triggers no agent. |+| **@all** | Notifies every workspace member; the mention itself starts no agent. A worker agent's comment still returns to the assigned squad leader, or the guest squad leader in its delegation thread, unless an agent or squad is explicitly mentioned. |Typing plain-text `@name` does not create a mention; pick from the editor's suggestion list. Typing a valid issue key converts it into an issue link automatically.diff --git a/apps/docs/content/docs/comments.zh-Hant.mdx b/apps/docs/content/docs/comments.zh-Hant.mdxindex 478a8fa4f2..aad7a3a2cc 100644--- a/apps/docs/content/docs/comments.zh-Hant.mdx+++ b/apps/docs/content/docs/comments.zh-Hant.mdx@@ -99,7 +99,7 @@ import { ResolveThreadDemo } from "@/components/demos/resolve-thread-demo";| **小隊** | 觸發小隊 leader 執行,不通知小隊成員。 || **任務** | 插入另一條任務的連結,不發通知,不觸發 AI 代理。 || **專案** | 插入一個專案的連結,不發通知,不觸發 AI 代理。 |-| **@all** | 通知全部工作區成員,不觸發任何 AI 代理。 |+| **@all** | 通知全部工作區成員;提及本身不啟動 AI 代理。工作 AI 代理的評論仍會交回任務所屬小隊的隊長,或委派執行緒中的客座小隊隊長,除非顯式提及了 AI 代理或小隊。 |直接輸入純文字 `@name` 不會建立提及,需從編輯器的候選列表中選擇。輸入有效的任務編號時,編輯器會自動轉換為任務連結。diff --git a/apps/docs/content/docs/comments.zh.mdx b/apps/docs/content/docs/comments.zh.mdxindex 8a2ab620a6..017429a3c5 100644--- a/apps/docs/content/docs/comments.zh.mdx+++ b/apps/docs/content/docs/comments.zh.mdx@@ -99,7 +99,7 @@ import { ResolveThreadDemo } from "@/components/demos/resolve-thread-demo";| **小队** | 触发小队 leader 执行,不通知小队成员。 || **任务** | 插入另一条任务的链接,不发通知,不触发智能体。 || **项目** | 插入一个项目的链接,不发通知,不触发智能体。 |-| **@all** | 通知全部工作区成员,不触发任何智能体。 |+| **@all** | 通知全部工作区成员;提及本身不启动智能体。工作智能体的评论仍会交回任务所属小队的队长,或委派线程中的客座小队队长,除非显式提及了智能体或小队。 |直接输入纯文本 `@name` 不会创建提及,需从编辑器的候选列表中选择。输入有效的任务编号时,编辑器会自动转换为任务链接。diff --git a/apps/docs/content/docs/squads.fr.mdx b/apps/docs/content/docs/squads.fr.mdxindex 18822b99c2..2d4feec685 100644--- a/apps/docs/content/docs/squads.fr.mdx+++ b/apps/docs/content/docs/squads.fr.mdx@@ -62,14 +62,16 @@ Après la première répartition, le chef est automatiquement réveillé par **l|---|---|---|| Un non-membre (rapporteur humain, agent externe) publie un commentaire | Oui | || Un membre du squad publie un point d'avancement sans `@mention` | Oui | Le chef réévalue si une étape suivante est nécessaire |-| Quelqu'un publie un commentaire qui mentionne explicitement avec `@` un autre agent / membre / squad / `@all` | Non | Le `@` explicite est le signal de routage ; le chef s'efface |+| Un membre humain mentionne uniquement d'autres membres ou `@all` | Non | Les personnes reçoivent des notifications ; le routage implicite vers les agents est désactivé |+| Un agent autre que le chef mentionne uniquement des membres ou `@all` | Oui | Le résultat du worker revient au chef ; les personnes reçoivent leurs notifications habituelles |+| Quelqu'un mentionne explicitement un agent ou un squad | Seulement s'il est nommé | Seuls les agents ou chefs de squad nommés sont exécutés ; aucun repli supplémentaire vers le chef || Le propre commentaire du chef | Non | Bloqué pour que le chef ne se déclenche pas lui-même || Un commentaire ne contenant qu'une référence croisée à une tâche (`[MUL-123](mention://issue/...)`) | Oui | Les références à des tâches ne constituent pas un routage |La déduplication s'ajoute à ces règles : si le chef a déjà une exécution `queued` ou `dispatched` sur cette tâche, un nouveau déclencheur ne met pas de doublon en file.<Callout type="info">-**Pourquoi le chef n'est pas déclenché lorsqu'un membre publie une mention `@`.** Dès qu'un membre du squad mentionne directement quelqu'un avec `@`, ce commentaire constitue une passation délibérée — réveiller le chef pour « observer » le routage ne produirait qu'un tour sans effet et encombrerait la chronologie. Les commentaires rédigés par des agents font exception : lorsqu'un agent publie un résultat qui mentionne un autre agent avec `@`, le chef est tout de même réveillé afin de pouvoir coordonner le fil.+Un commentaire `@membre` / `@all` rédigé par un membre humain ne fait que notifier des personnes. Le résultat d'un agent worker portant les mêmes mentions revient toujours au chef du squad assigné, ou au chef du squad invité dans son fil de délégation. Une mention explicite `@agent` / `@squad` ne route que vers les cibles nommées, quel que soit l'auteur du commentaire.</Callout>## Assigner ou @mentionner un squaddiff --git a/apps/docs/content/docs/squads.ja.mdx b/apps/docs/content/docs/squads.ja.mdxindex 6b47b874bd..d91b5f70cf 100644--- a/apps/docs/content/docs/squads.ja.mdx+++ b/apps/docs/content/docs/squads.ja.mdx@@ -62,14 +62,16 @@ import { SquadDemo } from "@/components/demos/squad-demo";|---|---|---|| スクワッド外の人(人間、外部のエージェント)がコメントする | する | || スクワッドのメンバーが `@` なしで進捗を投稿する | する | リーダーが次の手を評価し直す |-| コメントでエージェント、メンバー、スクワッド、`@all` のいずれかを明示的に `@` する | しない | 明示的な `@` がルーティングの合図なので、リーダーは手を出さない |+| 人間のメンバーが他のメンバーまたは `@all` だけをメンションする | しない | 人には通知が届くが、エージェントへの暗黙のルーティングは抑制される |+| リーダー以外のエージェントがメンバーまたは `@all` だけをメンションする | する | ワーカーの結果はリーダーに戻り、人への通知も通常どおり届く |+| 誰かがエージェントまたはスクワッドを明示的にメンションする | 指名された場合のみ | 指名されたエージェントまたはスクワッドのリーダーだけが実行され、リーダーへの追加のフォールバックはない || リーダー自身のコメント | しない | 自分で自分をトリガーしないようにするため || コメントにタスクへの相互リンクしかない | する | タスクの参照はルーティングとはみなさない |これらのルールに加えて重複排除があります。このタスクでリーダーの実行がすでにキュー待ちか取得済みなら、新しいトリガーで重複してキューに入ることはありません。<Callout type="info">-メンバーが `@` 付きでコメントしてもリーダーが起こされないのは、直接の `@` がすでに明確な引き継ぎだからです。そこでリーダーを起こしても、空回りのターンが 1 回増えるだけです。例外として、エージェントが結果を投稿するときに別のエージェントを `@` した場合は、スレッド全体を調整できるようリーダーも起こされます。+人間のメンバーによる `@メンバー` / `@all` コメントは、人への通知だけを行います。同じメンションを含むワーカーエージェントの結果は、割り当て先スクワッドのリーダーに戻ります。ゲストスクワッドの委任スレッドでは、そのゲストスクワッドのリーダーに戻ります。誰が投稿しても、明示的な `@エージェント` / `@スクワッド` は指名された対象だけにルーティングされます。</Callout>## スクワッドへの割り当てと @メンションdiff --git a/apps/docs/content/docs/squads.ko.mdx b/apps/docs/content/docs/squads.ko.mdxindex eed0e2688f..d00e5947d3 100644--- a/apps/docs/content/docs/squads.ko.mdx+++ b/apps/docs/content/docs/squads.ko.mdx@@ -62,14 +62,16 @@ import { SquadDemo } from "@/components/demos/squad-demo";|---|---|---|| 스쿼드 멤버가 아닌 쪽(사람, 외부 에이전트)이 댓글을 남김 | 예 | || 스쿼드 멤버가 `@` 없이 진행 상황을 올림 | 예 | 리더가 다음 단계를 다시 평가 |-| 댓글에서 에이전트, 멤버, 스쿼드, `@all` 중 하나를 명시적으로 `@`함 | 아니요 | 명시적인 `@`가 라우팅 신호이므로 리더는 물러남 |+| 사람 멤버가 다른 멤버 또는 `@all`만 멘션함 | 아니요 | 사람에게 알림이 전달되지만 암시적 에이전트 라우팅은 억제됨 |+| 리더가 아닌 에이전트가 멤버 또는 `@all`만 멘션함 | 예 | 워커의 결과는 리더에게 돌아가고 사람에게도 평소처럼 알림이 전달됨 |+| 누구든 에이전트 또는 스쿼드를 명시적으로 멘션함 | 지명된 경우에만 | 지명된 에이전트 또는 스쿼드 리더만 실행되며 리더로의 추가 폴백은 없음 || 리더 자신의 댓글 | 아니요 | 자기 자신을 트리거하지 않도록 막음 || 댓글에 태스크 상호 링크만 있음 | 예 | 태스크 참조는 라우팅으로 보지 않음 |이 규칙에 더해 중복 제거도 적용됩니다. 이 태스크에서 리더의 실행이 이미 대기 중이거나 가져간 상태라면, 새 트리거가 같은 실행을 또 큐에 넣지 않습니다.<Callout type="info">-멤버가 `@`를 넣어 댓글을 남겨도 리더가 깨어나지 않는 이유는, 직접 `@`한 것 자체가 이미 명확한 인계이기 때문입니다. 이때 리더를 깨우면 헛도는 턴만 하나 늘어납니다. 예외로, 에이전트가 결과를 올리면서 다른 에이전트를 `@`하면 스레드 전체를 조율할 수 있도록 리더도 깨어납니다.+사람 멤버가 작성한 `@멤버` / `@all` 댓글은 사람에게만 알림을 보냅니다. 같은 멘션을 포함한 워커 에이전트의 결과는 할당된 스쿼드 리더에게 돌아갑니다. 게스트 스쿼드의 위임 스레드에서는 해당 게스트 스쿼드 리더에게 돌아갑니다. 작성자가 누구든 명시적인 `@에이전트` / `@스쿼드`는 지명된 대상에게만 라우팅됩니다.</Callout>## 스쿼드 할당과 @스쿼드diff --git a/apps/docs/content/docs/squads.mdx b/apps/docs/content/docs/squads.mdxindex cc0fdd59f7..b534b7b779 100644--- a/apps/docs/content/docs/squads.mdx+++ b/apps/docs/content/docs/squads.mdx@@ -62,14 +62,16 @@ After the first dispatch, the leader is woken up automatically by **most subsequ|---|---|---|| A non-member (human reporter, external agent) posts a comment | Yes | || A squad member posts a progress update with no `@mention` | Yes | The leader re-evaluates whether a next step is needed |-| Anyone posts a comment that explicitly `@`-mentions another agent / member / squad / `@all` | No | The explicit `@` is the routing signal, so the leader stays out of the way |+| A human member mentions only other members or `@all` | No | People receive notifications; implicit agent routing is suppressed |+| A non-leader agent mentions only members or `@all` | Yes | The worker result still reaches the leader; people receive notifications as usual |+| Anyone explicitly mentions an agent or squad | Only if named | Only the named agents or squad leaders run; there is no additional leader fallback || The leader's own comment | No | Guarded so the leader can't trigger itself || A comment containing only an issue cross-reference (`[MUL-123](mention://issue/...)`) | Yes | Issue references aren't routing |Dedup applies on top of these rules: if the leader already has a `queued` or `dispatched` run on this issue, a new trigger won't enqueue a duplicate.<Callout type="info">-**Why the leader doesn't trigger when a member posts an `@`-mention.** Once a squad member directly `@`s someone, that comment is a deliberate hand-off — having the leader wake up to "observe" the routing would just produce a no-op turn and clutter the timeline. Agent-authored comments are the exception: when an agent posts a result that `@`s another agent, the leader still wakes up so it can coordinate the thread.+A human member's `@member` / `@all` comment only notifies people. A worker agent's result with the same mentions still returns to the assigned squad leader, or to the guest squad leader in its delegation thread. An explicit `@agent` / `@squad` routes only to the named targets, regardless of who wrote the comment.</Callout>## Assigning vs. @-mentioning a squaddiff --git a/apps/docs/content/docs/squads.zh-Hant.mdx b/apps/docs/content/docs/squads.zh-Hant.mdxindex 070e317bf0..2dcd0ed1ae 100644--- a/apps/docs/content/docs/squads.zh-Hant.mdx+++ b/apps/docs/content/docs/squads.zh-Hant.mdx@@ -62,14 +62,16 @@ import { SquadDemo } from "@/components/demos/squad-demo";|---|---|---|| 非小隊成員(人類、外部 AI 代理)發評論 | 會 | || 小隊成員發進展更新,不帶任何 `@` | 會 | 隊長重新評估下一步 |-| 任何評論裡顯式 `@` 了 AI 代理、成員、小隊或 `@all` | 不會 | 顯式 `@` 就是路由訊號,隊長讓位 |+| 人類成員的評論只提及其他成員或 `@all` | 不會 | 成員收到通知,隱式 AI 代理路由被抑制 |+| 非隊長 AI 代理的評論只提及成員或 `@all` | 會 | 工作 AI 代理的結果仍會交回隊長,成員照常收到通知 |+| 任何作者顯式提及 AI 代理或小隊 | 僅在被點名時 | 只執行被點名的 AI 代理或小隊隊長,不額外回退到隊長 || 隊長自己發的評論 | 不會 | 防止自己觸發自己 || 評論裡只有任務互鏈(`[MUL-123](mention://issue/...)`) | 會 | 任務引用不算路由 |在這些規則之上還有去重:如果隊長在這條任務上已有處於排隊或已領取狀態的執行,新觸發不會重複入隊。<Callout type="info">-成員發的 `@` 評論不喚醒隊長,是因為直接 `@` 已經是明確的交接,再喚醒隊長只會多一輪空轉。例外:AI 代理發結果時順手 `@` 了另一個 AI 代理,隊長仍會被喚醒,以便協調整條執行緒。+人類成員發的 `@成員` / `@all` 評論只通知人。工作 AI 代理發的結果即使帶有相同提及,仍會交回任務所屬小隊的隊長;在客座小隊的委派執行緒裡,則交回客座小隊隊長。無論作者是誰,顯式 `@ AI 代理` / `@小隊` 都只路由到被點名的目標。</Callout>## 分配小隊和 @小隊diff --git a/apps/docs/content/docs/squads.zh.mdx b/apps/docs/content/docs/squads.zh.mdxindex 77332a931a..41174efb5f 100644--- a/apps/docs/content/docs/squads.zh.mdx+++ b/apps/docs/content/docs/squads.zh.mdx@@ -62,14 +62,16 @@ import { SquadDemo } from "@/components/demos/squad-demo";|---|---|---|| 非小队成员(人类、外部智能体)发评论 | 会 | || 小队成员发进展更新,不带任何 `@` | 会 | 队长重新评估下一步 |-| 任何评论里显式 `@` 了智能体、成员、小队或 `@all` | 不会 | 显式 `@` 就是路由信号,队长让位 |+| 人类成员的评论只提及其他成员或 `@all` | 不会 | 成员收到通知,隐式智能体路由被抑制 |+| 非队长智能体的评论只提及成员或 `@all` | 会 | 工作智能体的结果仍会交回队长,成员照常收到通知 |+| 任何作者显式提及智能体或小队 | 仅在被点名时 | 只运行被点名的智能体或小队队长,不额外回退到队长 || 队长自己发的评论 | 不会 | 防止自己触发自己 || 评论里只有任务互链 | 会 | 任务引用不算路由 |在这些规则之上还有去重:如果队长在这条任务上已有处于排队或已领取状态的运行,新触发不会重复入队。<Callout type="info">-成员发的 `@` 评论不唤醒队长,是因为直接 `@` 已经是明确的交接,再唤醒队长只会多一轮空转。例外:智能体发结果时顺手 `@` 了另一个智能体,队长仍会被唤醒,以便协调整条线程。+人类成员发的 `@成员` / `@all` 评论只通知人。工作智能体发的结果即使带有相同提及,仍会交回任务所属小队的队长;在客座小队的委派线程里,则交回客座小队队长。无论作者是谁,显式 `@智能体` / `@小队` 都只路由到被点名的目标。</Callout>## 分配小队和 @小队diff --git a/server/internal/handler/comment.go b/server/internal/handler/comment.goindex d114dd348a..585c1d16e3 100644--- a/server/internal/handler/comment.go+++ b/server/internal/handler/comment.go@@ -2704,10 +2704,12 @@ func (h *Handler) computeCommentAgentTriggers(ctx context.Context, issue db.Issuif hasAgentOrSquadMention(mentions) {return h.resolveMentionedAgentCommentTriggers(ctx, issue, mentions, actorType, actorID, opts)}- if util.HasMentionAll(mentions) {- return nil, nil- }- if hasMemberMention(mentions) {+ // A member who @mentions people (a member or @all) and no agent/squad is+ // talking to humans, so the implicit fallbacks stay quiet. An agent's+ // member mention or @all only notifies humans: a worker result that pings+ // a reviewer still has to reach its squad leader, or the+ // leader→worker→leader loop stalls.+ if actorType == "member" && (util.HasMentionAll(mentions) || hasMemberMention(mentions)) {return nil, nil}diff --git a/server/internal/handler/squad_comment_trigger_test.go b/server/internal/handler/squad_comment_trigger_test.goindex 0d74b1788c..867df2c00e 100644--- a/server/internal/handler/squad_comment_trigger_test.go+++ b/server/internal/handler/squad_comment_trigger_test.go@@ -301,6 +301,31 @@ func TestShouldEnqueueSquadLeaderOnComment_AgentAuthoredWorkerCommentsWakeLeadert.Fatalf("explicit mention: expected no assigned-leader fallback, got wake")}})++ // Case 5: a worker result that @mentions a human or @all only notifies+ // people — it must still close the loop back to the leader, while the+ // leader's own self-trigger guard keeps holding for the same content.+ memberMention := "[@Bob](mention://member/" + testUserID + ")"+ for _, tc := range []struct{ name, content string }{+ {"member mention", memberMention + " please review the PR"},+ {"mention all", "[@all](mention://all/all) PR is up"},+ {"member mention and all", memberMention + " [@all](mention://all/all) PR is up"},+ } {+ content := tc.content+ t.Run("worker comment with "+tc.name+" wakes leader", func(t *testing.T) {+ clearTasks()+ if got := shouldEnqueueSquadLeaderOnCommentForTest(ctx, fx.Issue, content, "agent", fx.OtherID); !got {+ t.Fatalf("worker comment %q: expected leader to wake, got skip", content)+ }+ })+ t.Run("leader comment with "+tc.name+" does not self-trigger", func(t *testing.T) {+ clearTasks()+ insertLeaderTask(true, "completed")+ if got := shouldEnqueueSquadLeaderOnCommentForTest(ctx, fx.Issue, content, "agent", fx.LeaderID); got {+ t.Fatalf("leader self-trigger %q: expected skip, got wake", content)+ }+ })+ }}// TestCreateComment_SquadPlainReplyToMemberParentKeepsRootMentionOwner drives thediff --git a/server/internal/handler/squad_worker_comment_wakes_leader_test.go b/server/internal/handler/squad_worker_comment_wakes_leader_test.goindex 2b96986972..bab92e35d2 100644--- a/server/internal/handler/squad_worker_comment_wakes_leader_test.go+++ b/server/internal/handler/squad_worker_comment_wakes_leader_test.go@@ -50,6 +50,22 @@ func TestGuestSquadWorkerRouteOnMemberAssignedIssue_GH8301(t *testing.T) {if err != nil {t.Fatal(err)}+ // A human mention or @all in the worker's reply only notifies people; the+ // reply still returns to the guest leader.+ memberMention := "[@Bob](mention://member/" + testUserID + ")"+ for _, content := range []string{+ memberMention + " please review",+ "[@all](mention://all/all) done",+ memberMention + " [@all](mention://all/all) done",+ } {+ triggers, _ := testHandler.computeCommentAgentTriggers(ctx, fx.Issue, content, &parent, "agent", fx.OtherID, commentTriggerComputeOptions{+ AuthoringTaskID: parseUUID(workerTaskID), OriginatorUserID: testUserID,+ })+ if len(triggers) != 1 || triggers[0].Source != commentTriggerSourceThreadParent || triggers[0].Squad == nil ||+ uuidToString(triggers[0].Agent.ID) != fx.LeaderID || uuidToString(triggers[0].Squad.ID) != fx.SquadID {+ t.Fatalf("guest worker route for %q = %+v, want one squad leader thread-parent trigger", content, triggers)+ }+ }triggers, _ := testHandler.computeCommentAgentTriggers(ctx, fx.Issue, "done", &parent, "agent", fx.OtherID, commentTriggerComputeOptions{AuthoringTaskID: parseUUID(workerTaskID), OriginatorUserID: testUserID,})diff --git a/server/internal/service/builtin_skills/multica-platform/references/mentions.md b/server/internal/service/builtin_skills/multica-platform/references/mentions.mdindex 69bcc65b53..2f80211b9b 100644--- a/server/internal/service/builtin_skills/multica-platform/references/mentions.md+++ b/server/internal/service/builtin_skills/multica-platform/references/mentions.md@@ -114,18 +114,25 @@ is a no-op; a malformed UUID is rejected at the request boundary.It notifies every human member of the workspace except the author, not justpeople on this issue; notification preferences and private-project access-still apply. It does NOT make any specific agent run. And it is special at-trigger time: a comment that carries an `@all` mention is treated as a-broadcast that SUPPRESSES the issue assignee's automatic on-comment trigger-(and the other implicit routing fallbacks — thread parent / conversation-owner). Use `@all` to announce, not to request work from the assignee.+still apply. The mention itself does NOT make any specific agent run.-`@all` only suppresses those IMPLICIT routes. An EXPLICIT `@agent` / `@squad`+For MEMBER-authored comments, `@all` (or a member mention) SUPPRESSES the issue+assignee's automatic on-comment trigger and the other implicit routing+fallbacks — thread parent / conversation owner. Members can use `@all` to+announce without requesting work from the assignee.++For AGENT-authored comments, member mentions and `@all` do NOT suppress the+squad leader fallback. A worker's result on a squad-assigned issue still+returns to the assigned leader; in a guest squad's delegation thread, it still+returns to the guest leader. People receive notifications as usual, and the+existing leader self-trigger protection and pending-run dedup still apply.++For any author, an EXPLICIT `@agent` / `@squad`mention in the same comment still fires normally: a comment reading`[@all](mention://all/all) heads up — [@Preflight](mention://agent/<uuid>)please take this` enqueues Preflight and nobody else. The explicit-mention-branch is evaluated BEFORE the `@all` short-circuit, so explicit mentions win-over the broadcast.+branch is evaluated BEFORE the member-only suppression, so explicit mentions+win and there is no additional squad leader fallback.## What does NOT happen@@ -294,7 +301,9 @@ Correct:→ a real `user_id` parses; the link renders and resolves to Alice.@all broadcast: `[@all](mention://all/all) heads up` — notifies human workspace-members, runs no specific agent, and suppresses the assignee auto-trigger.+members and runs no specific agent by itself. It suppresses the assignee+auto-trigger only for member authors; worker-agent comments still return to+the assigned or guest squad leader as described above.Using the wrong `type` for a real UUID still parses — it just resolves to thewrong entity, or to nothing. That is why the type must match the id source.