← Back to PRs

#23513: fix(slack): respect replyToMode=off for inline directive reply tags

by dorukardahan open 2026-02-22 11:20 View on GitHub →
docs channel: slack size: XS
## Summary This ports the fix from #16113 onto current `main` and resolves the Slack reply-threading edge case where inline reply directive tags (e.g. `[[reply_to_current]]`) can still force threading even when `replyToMode: "off"`. ## Why a new PR? `#16113` is currently marked `CONFLICTING / DIRTY`, but the root problem appears to be older branch history divergence (`unrelated histories` against current `main`), not a small line-level merge conflict. This PR re-applies the same intent on top of current `main` with updated file paths/tests. ## Behavior - `replyToMode: "off"`: ignore inline directive `replyToId` so top-level replies stay in the channel root - `replyToMode: "all"`: preserve existing behavior and allow directive-driven threading - incoming thread replies remain threaded (unchanged) ## Changes - pass `replyToMode` through `dispatchPreparedSlackMessage(...)` into `deliverReplies(...)` - make `deliverReplies(...)` ignore directive `replyToId` when `replyToMode === "off"` - update Slack tool-result tests to cover both `off` and `all` - add changelog entry (ported intent from #16113) ## Tests 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 - [x] AI-assisted PR (Codex) - [x] Lightly tested (targeted unit test + formatting) - [x] I understand what the code does - [ ] Included prompts/session logs Supersedes #16113 <!-- greptile_comment --> <h3>Greptile Summary</h3> Ports the fix from #16113 to respect `replyToMode: "off"` for inline directive reply tags like `[[reply_to_current]]`. The implementation correctly ignores `payload.replyToId` when `replyToMode === "off"` in `deliverReplies()`, and the test coverage properly validates both the `off` and `all` modes. **Changes:** - Modified `deliverReplies()` in `src/slack/monitor/replies.ts` to check `replyToMode` before using directive-based `replyToId` - Passed `replyToMode` through `dispatchPreparedSlackMessage()` call chain - Split the existing test into two cases: one for `replyToMode: "off"` (ignores directive) and one for `replyToMode: "all"` (respects directive) - Added changelog entry **Issues found:** - Documentation at `docs/channels/slack.md:244` contradicts the new behavior and needs updating <h3>Confidence Score: 4/5</h3> - Safe to merge with one documentation fix needed - The code changes are clean and correct, test coverage is appropriate, and the fix addresses a real bug. Score is 4 (not 5) because the documentation contradicts the new behavior and must be updated before merge to avoid user confusion. - docs/channels/slack.md requires a documentation update to match the new behavior <sub>Last reviewed commit: 590d75b</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs