From 5e9b9b98182434f8454da198c086fa05c964c6ac Mon Sep 17 00:00:00 2001 From: Xubin Ren Date: Mon, 27 Apr 2026 03:47:34 +0000 Subject: [PATCH] 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 --- nanobot/channels/slack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nanobot/channels/slack.py b/nanobot/channels/slack.py index 8d0d8709..c79c65e6 100644 --- a/nanobot/channels/slack.py +++ b/nanobot/channels/slack.py @@ -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,