#25603·mastra

[BUG] Slack channel identity uses the bot's original auth.test username after an app rename, so channel mentions by display name are ignored

Author: tomasvargaCreated Sep 30, 2026Updated Sep 30, 2026
Labelsstatus: needs triage

Versions

  • @mastra/core 1.71.0, @mastra/factory 0.17.2, @chat-adapter/slack 4.41.0

Expected

After a Slack app's bot is renamed (App Home → Display Name / Default username), mentioning it by its current name in a channel is treated as addressed to the bot.

Actual

Slack keeps a bot user's username from the first install. auth.test keeps returning it (user: "acme-bot"), while users.info shows the new name (profile.real_name: "helper") and people mention the bot as @helper. ChatChannelProcessor tells the model:

Your identity on this platform is "acme-bot" / <@U…>. Messages containing these references are directed at you.

In channels it is also told to stay silent unless explicitly mentioned. The message text the model sees contains @helper …, so it concludes the message is for someone else and returns an empty reply. Its reasoning for such turns says it should respond "as helper, not as myself" and stay silent. DMs are unaffected.

Cause

  • @chat-adapter/slack sets adapter.userName = authResult.user in initialize(). This also overwrites the documented userName option ("Override bot username").
  • Mastra passes adapter.userName as botUserName to ChatChannelProcessor.
  • Factory's SlackIntegration doesn't pass a userName option at all.

Repro

  1. Create a Slack app with bot name acme-bot, install it, connect it to Factory.
  2. Rename the bot in App Home to helper (display name and default username) and reinstall. auth.test still returns acme-bot.
  3. Restart the server, invite the bot to a channel, send @helper say hi → no reply; the saved assistant message has only a reasoning part.

Suggested fix

Use the bot's profile name (users.info → profile.display_name, falling back to real_name) as the identity, or include it next to the username. Also keep an explicit userName option instead of overwriting it in initialize().

Related: #23096 (mentions as <@U…|Display Name>) would expose the bot's user id in the message text, which may let the model match it against <@U…>. It doesn't change the stale identity name, and it's still open.

Workaround

A host can wrap the Slack integration so that after the adapter's initialize(), it looks up users.info for adapter.botUserId and replaces adapter.userName with the profile name. We run this in production and channel mentions by display name work again.