Fix github add: catch channel_not_found, always DM caller, rename to 'add'#2
Merged
Fix github add: catch channel_not_found, always DM caller, rename to 'add'#2
Conversation
…'add' - Wrap channel reply (chat_postMessage) in try/except so channel_not_found no longer silently swallows results - Always DM the caller as a failsafe confirmation after invite - Fall back to ephemeral response when channel reply fails - Rename slash command from 'add-member' to 'add' - Update all docs, help text, and tests
…tilities - Extract repeated `if not _safe_reply ... _dm_caller` pattern into `_reply_or_dm()` helper (was duplicated 4 times in invite_and_greet) - Make `client` a required parameter in `invite_and_greet()` since all callers always provide it - Move shared test helpers (`make_slack_client`, `channel_messages`, `dm_messages`) from both test files into `tests/helpers.py` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
chat.postMessagecalls in the GitHub invite flow were failing withchannel_not_foundwhen the bot wasn't a member of the channel. The error bubbled to Bolt's generic handler, silently swallowing all feedback after "Looking up X on GitHub..." — even though the GitHub invitations themselves succeeded./nf-core github add-memberto/nf-core github add.Changes
invite_flow.pyinvite_and_greet()now accepts a requiredclientkeyword arg and wraps everyreply()call in_safe_reply()which catches exceptions and returnsFalse_reply_or_dm()helper deduplicates the reply-then-DM-fallback pattern (used at all 4 error sites)_dm_caller()add_member.py_warn_missing_github()now catcheschat.postMessagefailures and falls back to ephemeralrespond()client=clienttoinvite_and_greet()to enable DM failsafeadd_member_shortcut.pychat.postMessagein try/except withchat_postEphemeralfallbackclient=clienttoinvite_and_greet()router.pyadd-membertoaddDocs & tests
add-memberupdated toaddacross README, CLAUDE.md, docs/, help text, and testsTestDmFailsafecovering success DMs and channel-reply-failure fallbackmake_slack_client,channel_messages,dm_messages) extracted totests/helpers.pyTest plan
ruff checkcleanmypy --strictclean/nf-core github add octocatand verify channel reply + DM🤖 Generated with Claude Code