fix(slack): respect replyToMode=off for inline directive reply tags#23513
fix(slack): respect replyToMode=off for inline directive reply tags#23513dorukardahan wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: docs/channels/slack.md
Line: 244
Comment:
docs now contradict the new behavior — with this PR, `replyToMode="off"` **ignores** explicit `[[reply_to_*]]` tags (see `src/slack/monitor/replies.ts:25`)
```suggestion
Note: `replyToMode="off"` disables all reply threading, including explicit `[[reply_to_*]]` tags. To allow directive-driven threading, use `replyToMode="all"`.
```
How can I resolve this? If you propose a fix, please make it concise. |
arosstale
left a comment
There was a problem hiding this comment.
Correct fix. With replyToMode: "off" and allowExplicitReplyTagsWhenOff: false on the Slack dock (set by #22944), inline [[reply_to_current]] tags should be stripped — but the tool-result dispatch path was still honouring them because it bypassed the applyReplyThreading gate. Tests updated to assert threadTs: undefined when mode is off, and a separate all test preserves the threading behaviour for that mode.
|
@steipete quick clarification (now that #16113 has been closed in favor of this PR): This PR is not trying to remove agent overrides globally. The narrower issue (also called out in the approved review here) is that the Slack tool-result dispatch path was still honoring inline So If the intended design is that inline directive tags should always override |
590d75b to
ac73932
Compare
|
Consolidating this into #23839 so we ship one scoped Slack threading fix:
Closing this as superseded. |
|
Superseded by #23839. |
Summary
This ports the fix from #16113 onto current
mainand resolves the Slack reply-threading edge case where inline reply directive tags (e.g.[[reply_to_current]]) can still force threading even whenreplyToMode: "off".Why a new PR?
#16113is currently markedCONFLICTING / DIRTY, but the root problem appears to be older branch history divergence (unrelated historiesagainst currentmain), not a small line-level merge conflict. This PR re-applies the same intent on top of currentmainwith updated file paths/tests.Behavior
replyToMode: "off": ignore inline directivereplyToIdso top-level replies stay in the channel rootreplyToMode: "all": preserve existing behavior and allow directive-driven threadingChanges
replyToModethroughdispatchPreparedSlackMessage(...)intodeliverReplies(...)deliverReplies(...)ignore directivereplyToIdwhenreplyToMode === "off"offandallTests
Ran locally:
pnpm exec vitest run --config vitest.unit.config.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/monitor.tool-result.test.ts CHANGELOG.md✅Credit
Original fix intent and test coverage direction from @zerone0x in #16113. This PR is a current-main port to get it mergeable.
AI-assisted
Supersedes #16113
Greptile Summary
Ports the fix from #16113 to respect
replyToMode: "off"for inline directive reply tags like[[reply_to_current]]. The implementation correctly ignorespayload.replyToIdwhenreplyToMode === "off"indeliverReplies(), and the test coverage properly validates both theoffandallmodes.Changes:
deliverReplies()insrc/slack/monitor/replies.tsto checkreplyToModebefore using directive-basedreplyToIdreplyToModethroughdispatchPreparedSlackMessage()call chainreplyToMode: "off"(ignores directive) and one forreplyToMode: "all"(respects directive)Issues found:
docs/channels/slack.md:244contradicts the new behavior and needs updatingConfidence Score: 4/5
Last reviewed commit: 590d75b