Skip to content

fix(slack): don't reply /agent help to plain channel messages (v0.141.2)#243

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/slack-nonmention-help
Jul 13, 2026
Merged

fix(slack): don't reply /agent help to plain channel messages (v0.141.2)#243
vikasprogrammer merged 1 commit into
mainfrom
feat/slack-nonmention-help

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Problem

Sending a plain message to a Slack channel the bot sits in (no @mention) triggered the /agent router's help list:

👋 Address an agent with /<agent> followed by your request. Available: …

This should only happen on an explicit @mention or a DM.

Root cause

The Slack app subscribes to message.channels so that plain in-thread follow-up replies reach thread-continuity (documented in CLAUDE.md). But that subscription also delivers a message event for every post in a channel the bot is in. parseSlackEvent accepts any message, and in dispatch a non-continuation one fell straight through continueSlackThread (→ none) into fireSlackrouteChat, which posts the help list for an unaddressed message.

Discord never had this bug — parseDiscordMessage already returns null for a guild message that doesn't @-mention the bot.

Fix

After the thread-continuity check, only start a fresh run on an explicit @mention (app_mention) or a DM (im/mpim). A plain channel message now matters only as a thread continuation; otherwise it's dropped silently. Brings Slack to parity with Discord.

Verification

  • npm run typecheck
  • npm run build
  • npm run test:governance → 68/68 ✓

🤖 Generated with Claude Code

A plain message in a channel the bot sits in was getting the "👋 Address an
agent…" router help list. The Slack app subscribes to `message.channels` (needed
so plain in-thread follow-ups reach thread continuity), which also delivers a
`message` event for every channel post; a non-continuation one fell through to
fireSlack → the /agent router.

The socket now only starts a fresh run on an explicit @mention (app_mention) or a
DM (im/mpim). A plain channel message matters only as a thread continuation,
else it's dropped silently — matching Discord, whose parser already ignores
non-mention guild messages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vikasprogrammer vikasprogrammer merged commit 6f300d5 into main Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant