Skip to content

fix(slack): enforce replyToMode for auto-thread_ts and inline reply tags#23839

Merged
vincentkoc merged 3 commits intomainfrom
vincentkoc-code/slack-threading-mode-hardening
Feb 22, 2026
Merged

fix(slack): enforce replyToMode for auto-thread_ts and inline reply tags#23839
vincentkoc merged 3 commits intomainfrom
vincentkoc-code/slack-threading-mode-hardening

Conversation

@vincentkoc
Copy link
Member

@vincentkoc vincentkoc commented Feb 22, 2026

Summary

Consolidates and hardens the threading fixes from #23320 and #23513:

  • respect configured replyToMode when Slack auto-populates top-level thread_ts
  • only force thread continuity for genuine thread replies (isThreadReply=true)
  • ignore inline replyToId directive tags when replyToMode is off
  • keep inline replyToId behavior when replyToMode is all/first
  • add targeted regression tests and changelog entry

Why

Two separate leaks existed:

  1. auto-created top-level thread_ts could make replyToMode=off behave like all
  2. inline reply directive tags could force thread replies even when replyToMode=off

Both violate user threading preference and produce inconsistent Slack behavior.

Validation

  • pnpm test -- src/slack/threading.test.ts src/slack/monitor.tool-result.test.ts
  • pnpm exec oxfmt --check src/slack/monitor/replies.ts src/slack/monitor/message-handler/dispatch.ts src/slack/threading.ts src/slack/threading.test.ts src/slack/monitor.tool-result.test.ts CHANGELOG.md
  • pnpm exec oxlint src/slack/monitor/replies.ts src/slack/monitor/message-handler/dispatch.ts src/slack/threading.ts src/slack/threading.test.ts src/slack/monitor.tool-result.test.ts

Fixes: #5470
Fixes: #16080
Supersedes: #23320, #23513

Greptile Summary

Hardens Slack threading logic to respect the configured replyToMode setting by fixing two distinct leaks where threading was forced against user preference.

Key changes:

  • src/slack/threading.ts:51-55: Changed replyThreadTs resolution to only use incomingThreadTs when isThreadReply=true, preventing auto-created top-level thread_ts from forcing threading when replyToMode=off
  • src/slack/monitor/replies.ts:22-24: Added replyToMode guard to ignore inline replyToId directive tags when mode is off
  • src/slack/monitor/replies.ts:97-99: Simplified effective mode logic by removing chatType distinction and only forcing all mode for genuine thread replies (isThreadReply=true)
  • src/slack/monitor/message-handler/dispatch.ts:189: Propagated replyToMode to deliverReplies to enable the inline directive filtering

The changes preserve correct threading for genuine user thread replies (detected via parent_user_id or mismatched thread_ts !== ts) while preventing Slack's auto-populated thread_ts on top-level messages from overriding user configuration.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-scoped, logically sound, and backed by comprehensive test coverage. The fix addresses real user-facing bugs without introducing breaking changes. The threading logic simplification removes unnecessary complexity (chatType parameter) while preserving correctness for all edge cases. Tests explicitly cover both the regression scenarios and expected behavior for off, first, and all modes.
  • No files require special attention

Last reviewed commit: 6f6aab4

@vincentkoc vincentkoc force-pushed the vincentkoc-code/slack-threading-mode-hardening branch from 33ab9e1 to 6f6aab4 Compare February 22, 2026 19:29
@vincentkoc vincentkoc marked this pull request as ready for review February 22, 2026 19:29
@vincentkoc vincentkoc merged commit 71c2c59 into main Feb 22, 2026
9 checks passed
@vincentkoc vincentkoc deleted the vincentkoc-code/slack-threading-mode-hardening branch February 22, 2026 19:36
MisterGuy420 pushed a commit to MisterGuy420/openclaw-dev that referenced this pull request Feb 22, 2026
…ags (openclaw#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
@dorukardahan
Copy link
Contributor

Hey, thanks for consolidating our PRs (#22485, #23320, #23513) into #23836 and #23839! Could you add a co-author tag to the merge commits? Would be nice to have the attribution show up.

Co-authored-by: Doruk Ardahan <35905596+dorukardahan@users.noreply.github.com>

Thanks!

carlosrivera pushed a commit to myascendai/meshiclaw that referenced this pull request Feb 23, 2026
…ags (openclaw#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
gabrielkoo pushed a commit to gabrielkoo/openclaw that referenced this pull request Feb 23, 2026
…ags (openclaw#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
mreedr pushed a commit to mreedr/openclaw-custom that referenced this pull request Feb 24, 2026
…ags (openclaw#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
brianleach pushed a commit to brianleach/openclaw that referenced this pull request Feb 26, 2026
…ags (openclaw#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 26, 2026
…ags (openclaw#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…ags (openclaw#23839)

* Slack: respect replyToMode for auto-thread_ts and inline reply tags

* Update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR size: S

Projects

None yet

2 participants