Skip to content

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

Open
DugarMeha wants to merge 1 commit intofeature/darwinfrom
fix/askmoreinfo
Open

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

Conversation

@DugarMeha
Copy link

fix: Add Slack follow-up prompt for debugging details

Copy link

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.
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.

2 participants