Repository navigation
fix(slack): allowBots "mentions" admits untagged bot replies through implicit thread mentions - #160752
fix(slack): allowBots "mentions" admits untagged bot replies through implicit thread mentions#160752maxpuppet wants to merge 1 commit into
Conversation
…tions With allowBots: "mentions", the bot-sender gate accepted implicit mentions: an untagged bot reply to this bot's message (reply_to_bot) or in a thread this bot joined (bot_thread_participant). Two bots sharing a thread could wake each other until loop protection engaged. Disabling implicitMentions to stop that also forced humans to re-tag the bot on every thread follow-up. Bot senders now need a direct message, an explicit mention (native bot or user-group mention, app_mention, configured mention pattern), or the existing authorized-command bypass. Human senders keep implicit mentions. This matches the Discord mention-only contract for bot authors.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR requires explicit mentions from Slack bot senders in mentions-only mode while preserving implicit thread mentions for humans. Example: Bot B_OTHER posts “Continue here” in C123 after receiving bot B1 has participated, with allowBots set to "mentions".
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep open: the Slack admission defect remains on current main and the latest release, and the alternative PR does not yet supersede this work; the existing upgrade finding remains unresolved. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherSlack message preparation combines sender access, channel policy, explicit mentions, and thread facts before passing an admitted message to agent dispatch. flowchart LR
A[Slack event] --> B[Message handler]
B --> C[Sender and room access]
C --> D[Explicit and thread mention facts]
D --> E[Bot admission gate]
E --> F[Agent dispatch]
Technical reviewBest possible solution: Use the existing Slack bot-admission owner to stop unintended bot turns under an explicitly accepted upgrade policy. Do we have a high-confidence way to reproduce the issue? Current-main and released source combine enabled implicit thread facts into effectiveWasMentioned and admit the reported bot replies; the linked issue supplies concrete configuration and steps, with independent production corroboration. Is this the best way to solve the issue? The one-line gate change targets the correct owner and preserves human handling, but redefining shipped mentions-only behavior needs an explicit compatibility decision. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b6666b7eabb9. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +2, Tests +42, Docs +4. Total +48 across 4 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 19, 2026, 2:36 PM ET / 18:36 UTC (Revision 2). |
|
Independent production corroboration on 2026.9.8 (official core A human addressed several assistants in a shared Slack thread. Subsequent untagged bot completion acknowledgements and generic no-visible-reply notices kept waking thread participants and producing more bot messages. The bot-pair rate guard did not terminate the distributed loop. Temporarily disabling bot admission for that channel stopped it while preserving human intake. The faulty bot gate is also still present on official Our local mitigation rejects an unmentioned bot-authored follow-up under Evidence limits: our local gate accepts native bot/user-group mentions and For the maintainer compatibility decision: untagged handoffs will need explicit tags if this change is accepted. We prefer strict mentions behavior for bot senders while retaining implicit human follow-ups, and support documenting that upgrade impact. The related optional-reply problem in #141556 can amplify the loop; fixing admission and preserving optional silence address separate boundaries. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Fresh distribution corroboration (2026-10-19), following my October 4 incident report above. The official Artifact SHA-256:
These are offline compiled-code checks, not live Slack proof and not execution of this PR’s exact head. I am not claiming they satisfy the review’s real-Slack after-fix proof request. The earlier incident observation likewise remains scoped as documented above. The outstanding upstream decisions are clear: the author/maintainer must settle strict mentions versus an explicit opt-in upgrade policy, and complete the exact-head Slack event-to-dispatch proof requested by review. Our operational preference remains strict explicit bot mentions while preserving implicit human follow-ups. We are retaining the existing mitigation rather than creating another competing private repair or duplicate PR. Please keep this existing issue/PR as the canonical route for the resolution. |
|
Following the distribution corroboration above, I submitted #177555 as a compatibility-preserving alternative for the outstanding P1 upgrade concern here. It keeps the shipped behavior when omitted/false and offers Head: The official Slack E2E doctor could not authenticate the Convex broker from this seat, so no live Socket Mode or final-delivery proof is claimed. That remains separate from the handler-level integration proof. The proposal explicitly asks the Slack owner to accept or reject the opt-in contract before landing; it is not another downstream distribution. |
|
This pull request has been automatically marked as stale after 7 days without qualifying human activity. |
|
Closing due to inactivity. |
Closes #160750
What Problem This Solves
Fixes: with Slack
allowBots: "mentions", another bot's untagged reply in a thread this bot joined (or in a thread this bot started) is admitted as a mention, so two bots sharing a thread can wake each other.User Impact
User impact: in
"mentions"mode, bot-authored Slack messages need an explicit mention: native<@bot>,app_mention, a user-group mention that includes the bot, or a configured mention pattern. Human thread follow-ups keep their implicit mentions, so operators no longer have to turn offimplicitMentions(and make humans re-tag the bot) to stop bot-to-bot loops.Compatibility note: a bot handoff that relied only on an untagged reply in a shared thread must now tag the receiving bot. DMs,
allowBots: true, and the existing authorized text-command bypass are unchanged.Why This Change Was Made
The bot-sender gate accepted
effectiveWasMentioned, which folds in the implicit kindsreply_to_botandbot_thread_participant. It now accepts the explicitwasMentionedfact instead, keeping the DM and authorized-command paths. Human messages never reach this branch.Maintainer decision: I changed the meaning of
"mentions"rather than adding a new option. This follows the Discord precedent in #111821 / #111822, which made reply metadata stop admitting bot authors underallowBots: "mentions"instead of adding the opt-inimplicitReplyMentions.fromBotsproposed in #80235. Unlike Discord, this excludes both implicit kinds, because both are thread facts on Slack and the reported loop comes from thread participation. The original Slack mentions-mode proposal (#43588) described thread participation as admitting bots. If maintainers prefer to keep that, an opt-in flag is the alternative, but it would leave the loop-prone default in place.Evidence
requires an explicit mention from bots despite reply_to_bot|bot_thread_participant when allowBots is mentionsfails onmain(the untagged bot reply is admitted) and passes with this change. The same test then admits the bot once it writes<@bot>.keeps implicit thread mentions for human replies when allowBots is mentionspasses before and after (ImplicitMentionKinds: ["reply_to_bot"]).extensions/slack/src/monitor/message-handler/: 509/509 tests pass.extensions/slack/src/monitor/: 1383 tests pass. Two provider transport files fail to load identically onmainin my environment (Cannot find module '/node_modules/ws/wrapper.mjs', an artifact of my dependency layout).oxlintandoxfmt --check(code and docs) are clean.tscontsconfig.extensions.jsonandtest/tsconfig/tsconfig.extensions.test.jsonreports no Slack errors.prepare.bot-threads.test.tsruns in 7.1s wall with--maxWorkers=1(27 tests). The three new cases take 3–4 ms each.