fix: Add Slack follow-up prompt for debugging details#37
Open
DugarMeha wants to merge 1 commit intofeature/darwinfrom
Open
fix: Add Slack follow-up prompt for debugging details#37DugarMeha wants to merge 1 commit intofeature/darwinfrom
DugarMeha wants to merge 1 commit intofeature/darwinfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an additional Slack follow-up prompt to collect debugging details when a user clicks the “I need more help” / follow-up button, to speed up issue triage.
Changes:
- Post a new threaded message asking the user for environment and relevant IDs (tenant/org/connection) after the follow-up flow triggers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+299
to
+311
| respond_in_thread( | ||
| client=client.web_client, | ||
| channel=channel_id, | ||
| text=( | ||
| "To help us debug your issue faster, please share the following details:\n" | ||
| "- *Environment* (e.g., Production, Staging, alpha)\n" | ||
| "- *TenantId* and *Organization Id* \n" | ||
| "- *ConnectionId*\n" | ||
| ), | ||
| thread_ts=thread_ts, | ||
| unfurl=False, | ||
| ) | ||
|
|
There was a problem hiding this comment.
This message asks users to share potentially sensitive identifiers (Tenant/Organization/Connection IDs) directly in the thread, which may be a public channel. Consider sending this prompt as an ephemeral message to the clicker (via receiver_ids=[req.payload['user']['id']]) or only posting it when is_dm is true, and otherwise instruct users to DM the bot/support channel with those details.
Suggested change
| respond_in_thread( | |
| client=client.web_client, | |
| channel=channel_id, | |
| text=( | |
| "To help us debug your issue faster, please share the following details:\n" | |
| "- *Environment* (e.g., Production, Staging, alpha)\n" | |
| "- *TenantId* and *Organization Id* \n" | |
| "- *ConnectionId*\n" | |
| ), | |
| thread_ts=thread_ts, | |
| unfurl=False, | |
| ) | |
| debug_details_text = ( | |
| "To help us debug your issue faster, please share the following details:\n" | |
| "- *Environment* (e.g., Production, Staging, alpha)\n" | |
| "- *TenantId* and *Organization Id* \n" | |
| "- *ConnectionId*\n" | |
| ) | |
| if is_dm: | |
| # In a DM, it's safe to ask for detailed identifiers in-thread. | |
| respond_in_thread( | |
| client=client.web_client, | |
| channel=channel_id, | |
| text=debug_details_text, | |
| thread_ts=thread_ts, | |
| unfurl=False, | |
| ) | |
| else: | |
| # In a non-DM channel, send the detailed request as an ephemeral message | |
| # to the user who clicked, to avoid exposing identifiers in a public thread. | |
| user_info = cast(dict[str, Any], req.payload.get("user") or {}) | |
| user_id = cast(str | None, user_info.get("id")) | |
| if user_id: | |
| client.web_client.chat_postEphemeral( | |
| channel=channel_id, | |
| user=user_id, | |
| text=debug_details_text, | |
| thread_ts=thread_ts, | |
| ) | |
| else: | |
| # Fallback: generic public message that does not ask for sensitive IDs | |
| respond_in_thread( | |
| client=client.web_client, | |
| channel=channel_id, | |
| text=( | |
| "To help us debug your issue faster, please DM this bot or the " | |
| "support team with your environment, Tenant/Organization ID, " | |
| "and Connection ID." | |
| ), | |
| thread_ts=thread_ts, | |
| unfurl=False, | |
| ) |
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.
fix: Add Slack follow-up prompt for debugging details