INNER CODE UNIT · TypeScript

mention

agentconnect-md/agentconnect · packages/activation-policy/src/index.ts:179

  const mention = kindCandidates.find((r) => r.match.kind === 'mention')
  if (mention && verifiedAgentAuthor === undefined && (!msg.sender.isBot || msg.platform === 'slack')) {
    return pickRule(mention, 'mention')
  }
  // Only a VERIFIED AgentConnect author continues into the implicit rungs (§2.3); every other bot
  // stops here rather than falling through to dm/thread/keyword/auto.
  if (msg.sender.isBot && verifiedAgentAuthor === undefined) return null
  // An unmatched channel mention belongs to someone else, so thread affinity must not claim it —
  // otherwise every daemon believes its own agent owns the thread. A 1:1 DM is already addressed
  // to this bot (group DMs normalize isDm=false and stay mention-gated). A verified author is
  // exempt: a `<@…>` aimed at anyone must not silence its peers.
  if (!msg.isDm && msg.mentionedBots.length > 0 && verifiedAgentAuthor === undefined) return null

  // 2. thread affinity (§8.2 step 2 — highest after explicit @; bypasses kind filter).
  if (msg.thread) {
    const owner = threadOwner(msg.channel, msg.thread)
    if (owner) {
      // threadOwner returns the sole agent with an OPEN session in this thread, and

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…