fix: make replyToMode 'off' actually prevent threading in Slack#22944
fix: make replyToMode 'off' actually prevent threading in Slack#22944unboxed-ai wants to merge 1 commit intoopenclaw:mainfrom
Conversation
arosstale
left a comment
There was a problem hiding this comment.
Correct fix. allowExplicitReplyTagsWhenOff: true on the Slack dock was inconsistent with the documented behaviour — replyToMode: "off" should disable all threading including explicit tags, which is what the flag name says. The doc update explaining the Slack vs Telegram difference (Slack threads hide from channel, Telegram replies stay visible) is a good addition.
Additional Comments (1)
The core implementation in Prompt To Fix With AIThis is a comment left during a code review.
Path: extensions/slack/src/channel.ts
Line: 180
Comment:
update to match core behavior - set to `false`
The core implementation in `src/channels/dock.ts:476` was changed to `allowExplicitReplyTagsWhenOff: false`. While this extension value isn't currently used (core takes precedence), it should be updated to stay consistent.
```suggestion
allowExplicitReplyTagsWhenOff: false,
```
How can I resolve this? If you propose a fix, please make it concise. |
21038d1 to
41abcb3
Compare
Three independent bugs caused Slack replies to always create threads even when replyToMode was set to 'off': 1. Typing indicator created threads via statusThreadTs fallback (openclaw#16868) - resolveSlackThreadTargets fell back to messageTs for statusThreadTs - 'is typing...' was posted as thread reply, creating a thread - Fix: remove messageTs fallback, let statusThreadTs be undefined 2. [[reply_to_current]] tags bypassed replyToMode entirely (openclaw#16080) - Slack dock had allowExplicitReplyTagsWhenOff: true - Reply tags from system prompt always threaded regardless of config - Fix: set allowExplicitReplyTagsWhenOff to false for Slack 3. Contradictory replyToMode defaults in codebase (openclaw#20827) - monitor/provider.ts defaulted to 'all' - accounts.ts defaulted to 'off' (matching docs) - Fix: align provider.ts default to 'off' per documentation Fixes: openclaw#16868, openclaw#16080, openclaw#20827
5cc73e3 to
bfe7cfe
Compare
|
Maintainer triage pass (strict): this is the canonical PR for the Slack Current blocker is CI To make this merge-ready:
If needed, I can re-run a final dedupe sweep right before merge. |
|
Thanks for driving the canonical fix path here. I’m closing this in favor of #23799, which rebases this work on latest Credit is preserved from this PR and #18036 in the replacement branch. If anything is missing, call it out and I’ll reopen immediately. |
Summary
Three fixes that make
replyToMode: "off"work correctly for Slack.Changes
src/slack/threading.ts— RemovemessageTsfallback onstatusThreadTs. When no thread exists, the status thread timestamp should not fall back to the message timestamp, which creates a new thread. (Fixes Slack DM threading ignores replyToMode: off — statusThreadTs fallback creates threads #16868)src/channels/dock.ts— SetallowExplicitReplyTagsWhenOff: falsefor Slack. System prompt[[reply_to_current]]tags were bypassingreplyToMode: "off", creating threads. This is intentionally different from Telegram — see docs update below. (Fixes Slack plugin: [[reply_to_current]] tags bypass replyToMode=off #16080)src/slack/monitor/provider.ts— DefaultreplyToModefrom"all"to"off". The provider had"all"whileaccounts.tshad"off", contradicting documentation which states"off"is the default. (Fixes Slack: reply threading defaults/overrides are inconsistent (docs say off, monitor defaults all) #20827)docs/channels/slack.md— Updated to note that Slack strips explicit reply tags in"off"mode and why this differs from Telegram (Slack threads hide messages from channels; Telegram replies remain in the main chat flow).Migration Note
Existing installs that relied on the implicit
"all"default (replies always auto-threaded) should addchannels.slack.replyToMode: "all"to their config to maintain previous behavior. This aligns the runtime default with the documented default ("off").Testing
Code Review Discussion
The following findings were raised during automated code review (Codex CLI) and reviewed by humans:
Finding 1 (Medium): Default behavior change for unconfigured installs.
The
provider.tschange from"all"to"off"is a user-visible behavioral change. Existing installs that never setreplyToModewill stop auto-threading.Decision: Intentional. The docs already document
"off"as the default. The"all"fallback contradicted both docs andaccounts.ts. Migration path is simple: addreplyToMode: "all"to config.Finding 2 (Low): Status thread target lost for
replyToMode: "first".statusThreadTsnow equalsreplyThreadTs, which isundefinedfor"first"mode before the first reply.Decision: Not a real issue. The thread does not exist yet before the first reply — the old
messageTsfallback was a no-op on a non-existent thread.Finding 3 (Low): Docs conflict — explicit reply tags stripped in "off" mode.
allowExplicitReplyTagsWhenOff: falseconflicts with docs saying explicit tags are honored.Decision: Updated docs. Slack threads hide messages from channels, so
"off"should mean truly off. Telegram correctly keeps tags honored in"off"mode because replies stay visible in the main chat. The docs update explains this distinction.Greptile Summary
This PR fixes three bugs that prevented
replyToMode: "off"from actually disabling threading in Slack:threading.ts- removedmessageTsfallback forstatusThreadTs, preventing unwanted thread creation whenreplyToModeis"off"dock.ts- setallowExplicitReplyTagsWhenOff: falsefor Slack to strip[[reply_to_*]]tags in"off"mode (different from Telegram which keeps them)provider.ts- changed defaultreplyToModefrom"all"to"off"to align with documented default andaccounts.tsThe changes are well-tested with 3 test files updated to match the new behavior. The distinction between Slack (threads hide messages) and Telegram (replies stay visible) is clearly documented.
Minor issue: The extension file at
extensions/slack/src/channel.ts:180still hasallowExplicitReplyTagsWhenOff: true, though it's not actively used since the core implementation takes precedence. Updating it would keep the codebase consistent.Confidence Score: 5/5
statusThreadTsis now properly tied toreplyThreadTs, and thesetSlackThreadStatusfunction already handles undefined values gracefully. The default change aligns with existing documentation. The only minor issue is a cosmetic inconsistency in the extension file that doesn't affect runtime behavior.extensions/slack/src/channel.tsLast reviewed commit: 21038d1
(2/5) Greptile learns from your feedback when you react with thumbs up/down!