fix(slack): quiet logs — catch-all ack, no content leaks, throttled warnings - #70192
Merged
Conversation
Treat Slack users.conversations missing_scope as an expected limited-scope app condition and fall back to session history without recurring warnings. Add tests for not-ok and SlackApiError-like missing_scope responses.
…ng Event Subscriptions Without a catch-all handler, slack-bolt returns HTTP 404 for every unhandled bot event (user_change, user_huddle_changed, reaction_added, etc.) and never sends the Socket Mode ack. On active Slack workspaces where the app is subscribed to high-volume events, this produces a near-100% un-acked failure rate that crosses Slack's >95%/60-min threshold and triggers automatic disabling of the app's Event Subscriptions — silently killing all inbound event delivery. Place a catch-all re.compile(r".*") handler AFTER the specific event handlers so bolt's router matches those first. Truly unhandled events are silently acked (200) and logged at DEBUG. The failure rate stays near 0% regardless of which events the Slack app manifest subscribes to. Fixes #6572
…dcrumbs in channels Slack posts are durable workspace messages, not an ephemeral terminal status area. Default long_running_notifications and busy_ack_detail to off for Slack so long-running agent work does not leave permanent operational breadcrumbs like 'Working — 9 min — iteration 12/90' in channels. Both remain opt-in per platform via display.platforms.slack.*. Also covers the platform-generic shutdown-notification mute path with a regression test (gateway_restart_notification=false must suppress both the active-session interruption notice and the home-channel copy). Salvaged from #69028 (quiet-defaults half only). The PR's other half — the channel_session_scope_channels session-scoping feature — is a new config feature outside this log-noise cluster and overlaps the session scoping territory reworked by merged wave-1/2 Slack session work; it is deliberately not taken here.
Regression test for the catch-all ack: a re.compile(r'.*') event matcher must be registered (after every named handler, so it never shadows message/app_mention/reaction/file routing) and must match unhandled subscribed event types like member_joined_channel / channel_archive / pin_added. Salvaged from #64218 (test half only — its adapter-side catch-all is a duplicate of #38847, which landed as the base commit of this cluster with first-submitter credit). Fixes #6572. Co-authored-by: shivasymbl <sdevinarayanan@asymbl.com>
… text out of INFO logs Follow-up hardening for the C13 log-noise cluster: - plugins/platforms/slack/adapter.py: clarify button resolution logged the full chosen option text at INFO (choice=%r). Choice text is user content — log the choice INDEX at INFO and the (truncated, %.100r) text at DEBUG only. Widens #58478's principle: no message content above DEBUG level anywhere in the adapter. - tests/gateway/test_slack_log_noise.py (new): behavioral suite pinning the cluster's invariants: * catch-all ack registered AFTER every named handler (registration order is bolt's dispatch priority — no shadowing); * catch-all fires for an unsubscribed event type (reaction_added), logs only a DEBUG line naming the type, and never logs content; * named handlers still dispatch (message → _handle_slack_message); * end-to-end inbound message run leaves NO message text or block content in any adapter log record (caplog at DEBUG); * #30185's event-arrival diagnostic is metadata-only; * clarify resolution: INFO carries index/user only, text is DEBUG-only (fails with the adapter fix reverted — A/B verified). Content-leak audit of all 139 logger call sites in the adapter found two above-DEBUG leaks: the clarify choice line (fixed here) and none else carrying message text; remaining sites log error strings, URLs via safe_url_for_log, ids, and counts. The block-extraction DEBUG preview was already removed by #58478 (chars= length only).
- sdevinarayanan@asymbl.com -> shivasymbl (#38847) - mycodeisbad@gmail.com -> peterw (#69028; commit author name 'wpeterr' — PR opened by the peterw account, mapping follows the PR author) LeonSGP43, ooiuuii, ygd58 mappings already present; nanckh and haran2001 author via GitHub noreply addresses (no mapping needed).
…ient_msg_id) #58478's caplog test predates main's unlabeled-bot users.info probe (#69xxx wave-2 gating): events without client_msg_id now hit _resolve_user_is_bot, which the fixture's mock client doesn't wire up (AttributeError on _user_is_bot_cache). Real human-authored Slack messages carry client_msg_id — add it to the fixture so the test exercises the intended block-extraction path.
Contributor
૮ >ﻌ< ა ci reviewran on 599485b all good! |
This was referenced Jul 23, 2026
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
Slack logging is now quiet, private, and useful: unhandled events are acked (no more Bolt WARNINGs — and no more Slack auto-disabling Event Subscriptions at scale), message content never appears above debug level, and repeated channel-directory warnings throttle to once an hour.
Fixes #6572, #58477.
Changes
Credits
Salvaged with authorship preserved: #38847 (@shivasymbl, earliest for the ack), #58478 (@ooiuuii), #38137 (@nanckh), #18683 (@LeonSGP43), #36670 (@jakelongvu-bot), #30185 (@haran2001), #69028 (@peterw, partial).
Supersedes #64218 (later duplicate of the ack).
Validation
tests/gateway/ -q -k slackInfographic