Skip to content

Your lightweight open-source personal agent.

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

Xubin Ren5e9b9b981824
diff --git a/nanobot/channels/slack.py b/nanobot/channels/slack.py
index 8d0d8709c..c79c65e69 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,