mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-29 19:22:35 +00:00
When the Slack adapter's startup auth.test call fails (bad token, transient error, etc.), the bot user id silently stays empty for the life of the process. The downstream explicit-bot mention check is `botUserId && mentionedUserIds.includes(botUserId)`, which always returns false when botUserId is empty. The result is that explicit <@bot> mentions are silently classified as non-mentions with no log trace explaining why. Changes: - provider.ts: stop swallowing auth.test failures; emit a warn log at boot so the degraded state is observable. Empty user_id is treated as a failure too. - prepare.ts + subteam-mentions.ts: export the existing normalizeSlackId helper and apply it to both sides of the explicit-bot equality check (and to the mentioned-ids list). Real Slack ids are already uppercase, so this is a no-op on healthy traffic, but it locks the invariant down and removes the asymmetry between collected ids and the ctx bot id. - prepare.test.ts: add two regression tests pinning the exact symptom: positive case (botUserId set -> explicit_bot), negative case (botUserId='' -> not explicit_bot, mention_source not explicit_bot). 🤖 AI-assisted. Co-authored-by: in-liberty420 <in-liberty420@users.noreply.github.com>