fix(slack_app): post project command replies at channel root for top-level mentions - #73097
Merged
Merged
Conversation
|
😎 This pull request was merged. |
…ntions The @PostHog command reply used the mention's own ts as the thread anchor when the mention wasn't already in a thread. Slack renders a thread-anchored ephemeral only to a user actively viewing that thread, so from a top-level mention it read as no response. Anchor to thread_ts only when the command was posted in a real thread; otherwise post at channel root where the user sees it. This covers every project/rules/help reply on both the mention and slash surfaces, and keeps them ephemeral.
VojtechBartos
force-pushed
the
vojtab/slack-project-show-visible-reply
branch
from
July 23, 2026 09:13
2bd5581 to
46eb877
Compare
VojtechBartos
marked this pull request as ready for review
July 23, 2026 09:17
Contributor
|
Reviews (1): Last reviewed commit: "fix(slack_app): post command replies at ..." | Re-trigger Greptile |
andrewm4894
approved these changes
Jul 23, 2026
VojtechBartos
enabled auto-merge (squash)
July 23, 2026 09:30
dkarasiewicz
approved these changes
Jul 23, 2026
2 tasks
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.
Problem
@PostHog project(and the otherproject/rules/helpcommand replies) gave no visible response when the command was a top-level mention. The reply used the mention's owntsas the thread anchor, and Slack only renders a thread-anchored ephemeral to a user who is actively viewing that thread. Posted at the channel root, the user was never in that thread, so it read as the bot ignoring them. See ticket 64409.Changes
One line in
handle_posthog_code_slack_mention_command_activity: anchor the reply tothread_tsonly when the command was actually posted in a thread. For a top-level mention (or a slash command outside a thread) the anchor is empty, so the reply lands at the channel root where the user sees it.The empty-anchor-posts-at-root behavior already existed for the slash surface; this just stops the mention surface from falling back to its own
ts. It covers everyproject/rules/helpreply on both surfaces and keeps them ephemeral, so it also fixes the original ticket (the "Default set to…" confirmation onproject <id>now shows even when the project is unchanged) without needing the no-op special-casing from #73021.The
rules addpicker is untouched — the workflow computes its own thread anchor for the interactive flow.How did you test this code?
Corrected the existing parameterized test in
test_mention_command_activity.py: its "in thread" case only setts(nothread_ts), so it was really a top-level mention asserting the old buggy anchor. Split it into a genuine top-level case (tsonly → root) and a real in-thread case (thread_tsset → threads there), plus the existing slash case. The top-level case is the regression guard — if theor event.get("ts")fallback comes back, it fails. 3 cases pass locally. Ranruff. Not tested in a live Slack workspace.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
I (Vojta) directed this. Claude traced the mention → command workflow →
handle_posthog_code_slack_mention_command_activity→ handler path. We first tried making just theprojectshow reply a visiblechat_postMessage, then landed on this smaller root-cause fix: keep everything ephemeral and only drop the thread anchor for top-level mentions, which fixes all the command replies at once./writing-testswas invoked for the test change.