feat(slack): add thread.autoReplyOnParticipation config option#41811
feat(slack): add thread.autoReplyOnParticipation config option#41811carrotRakko wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds a new opt-out config option Key changes:
The implementation is minimal and safe. Direct mentions always trigger a reply regardless of this setting, and thread participation tracking itself is unchanged. Confidence Score: 4/5
Last reviewed commit: 11c3909 |
Replace manual mock cleanup with mockReturnValueOnce in thread participation opt-out test. The previous pattern left the mock in an inconsistent state if the assertion failed before the cleanup line. Related: openclaw#41811 ✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
6ab932d to
585afc5
Compare
Replace manual mock cleanup with mockReturnValueOnce in thread participation opt-out test. The previous pattern left the mock in an inconsistent state if the assertion failed before the cleanup line. Related: openclaw#41811 ✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
PR openclaw#29165 added always-on thread participation auto-reply that bypasses requireMention gating with no opt-out. Add a config option under channels.slack.thread to disable this behavior: channels.slack.thread.autoReplyOnParticipation: false When false, hasSlackThreadParticipation() is skipped and implicitMention only fires for parent_user_id === botUserId (the pre-openclaw#29165 behavior). Default: true (preserves current behavior). Closes openclaw#31728 ✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
Replace manual mock cleanup with mockReturnValueOnce in thread participation opt-out test. The previous pattern left the mock in an inconsistent state if the assertion failed before the cleanup line. Related: openclaw#41811 ✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
585afc5 to
a0d13d3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0d13d3896
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary
requireMentionis enabled. This bypasses the operator's intent to require explicit mentions.requireMention: trueexpect the bot to stay quiet unless mentioned. The participation auto-reply breaks this contract, causing unexpected bot responses in active threads.thread.autoReplyOnParticipation(default:truefor backward compatibility). Setting it tofalsedisables the participation-based auto-reply, restoringrequireMentionbehavior in threads.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
New Slack config option:
When
false, the bot only replies in threads when explicitly mentioned, even if it has previously participated in that thread.Security Impact (required)
Repro + Verification
Environment
slack.thread.autoReplyOnParticipation: falseSteps
requireMention: trueandthread.autoReplyOnParticipation: falseExpected
Actual
Evidence
Tests in
prepare.test.ts,context.test.ts, andmonitor.test.tsverify opt-out behavior and config propagation.Human Verification (required)
requireMentionin threads whenautoReplyOnParticipation: false.truepreserves existing behavior. Config propagated through monitor → context → prepare pipeline.Review Conversations
N/A — fresh PR, no review conversations yet.
Compatibility / Migration
truepreserves existing behaviorslack.thread.autoReplyOnParticipationFailure Recovery (if this breaks)
thread.autoReplyOnParticipationfrom config (defaults totrue).src/slack/monitor/message-handler/prepare.ts,src/slack/monitor/context.tsRisks and Mitigations
None — additive config option with backward-compatible default.
✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)