Skip to content

Commit 68ea1ea

Browse files
alexsohn1126claude
andcommitted
fix(seer-slack): Allow history access for DMs and assistant threads
Assistant threads are DMs under the hood, so the bot can always read its own conversation history without channels:history or groups:history. Without this, has_history_scope returned False for DMs, blocking thread context fetching and showing a misleading missing-scope footer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fed458f commit 68ea1ea

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sentry/integrations/slack/integration.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,20 @@ def has_history_scope(self, channel_id: str) -> bool:
237237
channel_info = conversation_data.get("channel", {})
238238
is_channel = channel_info.get("is_channel", False)
239239
is_private = channel_info.get("is_private", False)
240+
is_im = channel_info.get("is_im", False)
241+
242+
# DMs and assistant threads: the bot is a participant and can
243+
# always read its own conversation history.
244+
if is_im:
245+
return True
240246

241247
if is_channel and is_private:
242248
return SlackScope.GROUPS_HISTORY in installed_scope_set
243249
if is_channel:
244250
return SlackScope.CHANNELS_HISTORY in installed_scope_set
245251

246-
# shouldn't reach here unless channel_info is empty (most likely an api error), since a mention webhook should only come from channels
252+
# Shouldn't reach here unless channel_info is empty (most likely
253+
# an API error or an unrecognized conversation type).
247254
return False
248255

249256
def get_conversations_info(

0 commit comments

Comments
 (0)