fix(slack): skip thread context for slash commands so /restart is not buried

_with_thread_context prepends conversation history to the message
content.  This turned "/restart" into "Slack thread context...\n\n
Current message:\n/restart", which the command router could not match
as a priority command.  Skip the context enrichment when the stripped
text starts with "/".

Made-with: Cursor
This commit is contained in:
Xubin Ren 2026-04-27 03:47:34 +00:00 committed by Xubin Ren
parent 1fe3f0eb22
commit 5e9b9b9818

View File

@ -348,7 +348,8 @@ class SlackChannel(BaseChannel):
# Thread-scoped session key for channel/group messages
session_key = f"slack:{chat_id}:{thread_ts}" if thread_ts and channel_type != "im" else None
content = await self._with_thread_context(
is_slash = text.strip().startswith("/")
content = text if is_slash else await self._with_thread_context(
text,
chat_id=chat_id,
channel_type=channel_type,