fix(slack): retain public channel discovery without groups scope#71114
Open
Vasallius wants to merge 1 commit into
Open
fix(slack): retain public channel discovery without groups scope#71114Vasallius wants to merge 1 commit into
Vasallius wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve Slack public-channel discovery when an app has
channels:readbut intentionally lacksgroups:read.users.conversations(types="public_channel,private_channel")requires both scope families. Today, amissing_scoperesponse causes Hermes to abandon API discovery entirely and fall back to session history, even though a public-only request would succeed.This change retries once with
types="public_channel"after a combined request fails withmissing_scope. If the public-only request also lacks scope, the existing quiet session-history fallback remains unchanged.Production evidence
A long-running HawkFi gateway with
channels:readbut nogroups:readlogged the same channel-directorymissing_scopefailure every five minutes. The combined request prevented discovery of public channels the app was already authorized to read, and generated recurring operational noise.Safety
Verification
uv run --frozen --extra dev pytest tests/gateway/test_channel_directory.py -q— 46 passeduv run --frozen --extra dev ruff check gateway/channel_directory.py tests/gateway/test_channel_directory.py— passedgit diff --check— passedTests cover response-object fallback, exception fallback, and the no-public-scope quiet fallback.