Skip to content

fix: Add Slack follow-up prompt for debugging details#37

Open
DugarMeha wants to merge 2 commits intofeature/darwinfrom
fix/askmoreinfo
Open

fix: Add Slack follow-up prompt for debugging details#37
DugarMeha wants to merge 2 commits intofeature/darwinfrom
fix/askmoreinfo

Conversation

@DugarMeha
Copy link
Copy Markdown

fix: Add Slack follow-up prompt for debugging details

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
)

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
)

Copilot uses AI. Check for mistakes.
@swati354
Copy link
Copy Markdown
Collaborator

  1. We cannot hardcode a message for the follow-up buttons. This configuration applies to all the channels which have that button enabled, and they may not need these specific details.
  2. We have a curated response feature, that lets you configure message per channel. More details here -
    feat: enabling curated responses if user asks for more help  #29
    Could we append this message there instead? (It can only be updated through Darwin's UI, which only the Darwin team has access to. So if this works for you, please let us know)

@bharadwajturlapati bharadwajturlapati self-requested a review March 11, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants