fix(gateway): use /hermes sethome in onboarding hint on Slack

Slack's adapter registers a single parent slash command /hermes and
dispatches subcommands via slack_subcommand_map(). Bare /sethome is
not a registered command on Slack and fails with 'app did not
respond', logging 'Unhandled request' in slack_bolt.AsyncApp.

Show /hermes sethome in the first-run onboarding hint when the
source platform is Slack; keep /sethome for Telegram, Discord,
Matrix, Mattermost, and other platforms that register it directly.

Fixes #14632
This commit is contained in:
Zhi Yan Liu 2026-04-24 00:24:20 +08:00 committed by Teknium
parent 1dfcc2ffc3
commit d993a3f450

View File

@ -4606,12 +4606,20 @@ class GatewayRunner:
if not os.getenv(env_key):
adapter = self.adapters.get(source.platform)
if adapter:
# Slack dispatches all Hermes commands through a single
# parent slash command `/hermes`; bare `/sethome` is not
# registered and would fail with "app did not respond".
sethome_cmd = (
"/hermes sethome"
if source.platform == Platform.SLACK
else "/sethome"
)
await adapter.send(
source.chat_id,
f"📬 No home channel is set for {platform_name.title()}. "
f"A home channel is where Hermes delivers cron job results "
f"and cross-platform messages.\n\n"
f"Type /sethome to make this chat your home channel, "
f"Type {sethome_cmd} to make this chat your home channel, "
f"or ignore to skip."
)