#22476: fix(slack): add streamMode to Zod schema and support "off" mode
channel: slack
size: XS
Cluster:
Signal and Discord Fixes
## Summary
- **Bug fix:** `streamMode` is read at runtime in `dispatch.ts` via `resolveSlackStreamMode(account.config.streamMode)` but was missing from `SlackAccountSchema` in the Zod validation schema. Since the schema uses `.strict()`, setting `streamMode` in the Slack account config caused silent validation failure and the gateway would hang during startup with no error message.
- **Feature:** Adds `"off"` mode that disables the draft stream entirely — no intermediate messages are posted, only the final reply is delivered. This is useful when `streaming: false` is set (disabling native Slack streaming) but the draft stream still progressively edits messages via `chat.postMessage` + `chat.update` (the two are independent mechanisms).
## Changes
1. `src/config/zod-schema.providers-core.ts` — Add `streamMode` enum to `SlackAccountSchema` (`"replace" | "status_final" | "append" | "off"`)
2. `src/slack/stream-mode.ts` — Add `"off"` to `SlackStreamMode` type and `resolveSlackStreamMode` resolver
3. `src/slack/monitor/message-handler/dispatch.ts` — Early return in `updateDraftFromPartial` when `streamMode === "off"`
## Context
- Discord already has `streamMode` in its schema (added in #22111)
- Telegram has `streamMode` in its schema with `"off"` as default
- Slack was the only channel where `streamMode` was referenced in runtime code but missing from the Zod schema
## Test plan
- [x] Set `streamMode: "off"` in Slack account config — verify gateway starts without validation error
- [x] Send a message to the bot — verify no draft/preview message is posted, only the final reply
- [x] Set `streamMode: "replace"` — verify progressive editing still works
- [x] Omit `streamMode` — verify default `"replace"` behavior is unchanged
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds missing `streamMode` field to `SlackAccountSchema` and introduces `"off"` mode to disable draft stream updates. The field was already used at runtime via `resolveSlackStreamMode()` but missing from the Zod validation schema, causing silent validation failures due to `.strict()` mode.
- Fixed schema validation by adding `streamMode` enum with values `"replace" | "status_final" | "append" | "off"`
- Added `"off"` mode support to `SlackStreamMode` type and resolver function
- Implemented early-return in `updateDraftFromPartial()` when `streamMode === "off"` to skip all draft message updates
- Final replies still delivered correctly through `dispatchInboundMessage` (independent from draft stream)
<h3>Confidence Score: 4/5</h3>
- Safe to merge with minor improvements suggested
- The core fix is correct — adds missing schema field and implements `"off"` mode properly. Early-return logic prevents draft updates while final replies are still delivered. Minor style suggestions: explicit schema default and test coverage for the new mode would improve consistency with other channels.
- No files require special attention
<sub>Last reviewed commit: 288fa30</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#17579: fix(slack): prevent Zod default groupPolicy from breaking multi-acc...
by ZetiMente · 2026-02-15
80.6%
#11608: feat(slack): native streaming, Block Kit blocks, tool-aware status
by joshdavisind · 2026-02-08
79.3%
#20623: fix(slack): duplicate replies and missing streaming recipient params
by rahulsub-be · 2026-02-19
76.7%
#15864: feat: add deliverOnlyToolMessages config for clean messaging channe...
by gandalf-the-engineer · 2026-02-14
73.9%
#10943: fix(config): resolve Control UI "Unsupported schema node" for confi...
by kraftbj · 2026-02-07
73.4%
#20818: feat(telegram): add draftMinInitialChars and initialDraftText confi...
by lingzhua77 · 2026-02-19
73.2%
#23799: fix(slack): finalize replyToMode off threading behavior
by vincentkoc · 2026-02-22
72.8%
#23118: fix(slack): await draft stream flush before messageId check
by dashed · 2026-02-22
72.5%
#18656: fix(signal): add missing groups field to Signal channel schema (#18...
by awkoy · 2026-02-16
72.1%
#20248: fix(slack): flush draft stream before final reply to preserve messa...
by Utkarshbhimte · 2026-02-18
72.0%