fix(slack): respect replyToMode=off for inline directive reply tags#16113
fix(slack): respect replyToMode=off for inline directive reply tags#16113zerone0x wants to merge 1 commit intoopenclaw:mainfrom
Conversation
bfc1ccb to
f92900f
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Ported this fix to a new PR on current Reason: this PR is showing
Credit to @zerone0x for the original fix direction here. |
|
I built this by design that agents can override the default reply mode. What's your motivation of changing it? |
|
Totally fair question — and thanks for calling that out. The motivation here is not to remove agent overrides in general, but to treat What we observed in practice:
So the proposed behavior was: keep That said, if the intended design is explicitly “agents should always be able to override
Also, I ported the change to current |
|
Closing in favor of #23513 which covers the same fix and has already received an approval. Thanks! |
Summary
Fixes #16080
When
replyToModeis set to"off"(the default), agent responses containing[[reply_to_current]]tags were still sent as Slack thread replies instead of regular channel messages. This happened becausedeliverReplies()usedpayload.replyToId(from parsed inline directives) unconditionally, bypassing thereplyToModecheck.Changes
src/slack/monitor/replies.ts: Add optionalreplyToModeparam todeliverReplies(). WhenreplyToMode === "off", ignorepayload.replyToIdfrom inline directives, consistent with how the Telegram plugin handles this (line 94 ofsrc/telegram/bot/delivery.ts).src/slack/monitor/message-handler/dispatch.ts: Passctx.replyToModethrough todeliverReplies().threadTs: "555"whenreplyToMode: "off"). Now correctly expectsthreadTs: undefined. Added a new test confirmingreplyToIdis still honored whenreplyToMode: "all".Test Plan
replyToIdignored whenreplyToMode: "off"(new test)replyToIdhonored whenreplyToMode: "all"(new test)"first"and"all"modes🤖 Generated with Claude Code (issue-hunter-pro)
Greptile Summary
This PR fixes a bug where inline directive reply tags (
[[reply_to_current]]) from agent responses were creating Slack thread replies even whenreplyToModewas set to"off". The fix adds areplyToModeparameter todeliverReplies()and filters outpayload.replyToIdwhen the mode is"off", aligning Slack's behavior with how Telegram already handles this case.replyToModeparameter todeliverReplies()insrc/slack/monitor/replies.ts:20replyToMode === "off", inline directivereplyToIdis now ignored (line 25)ctx.replyToModefrom dispatch layer (line 118 ofdispatch.ts)threadTs: undefinedwhen mode is"off"(previously incorrectly expectedthreadTs: "555")replyToIdstill works whenreplyToMode: "all"Confidence Score: 5/5
src/telegram/bot/delivery.ts), ensuring consistency across channels. Test coverage is comprehensive with both the buggy behavior corrected and a new test for the"all"mode added. The implementation is a simple conditional check with no complex logic or side effects.Last reviewed commit: 2b6c139