Slack stream: text after plan/task chunks is rejected with streaming_mode_mismatch and lost
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start by reading SlackAdapter.stream() and sendDelta in the Slack adapter, then trace how sendStructuredChunk appends chunks. Reproduce the sequence from the issue with a structured chunk followed by a text delta. Done when text after structured chunks appears in the final Slack message without streaming_mode_mismatch.
Written by the indexing model from the issue text.
Description
What happens
With native streaming and structured chunks (for example Mastra's toolDisplay: 'grouped', which streams plan_update/task_update), the reply's text never shows up in the final Slack message. The message ends with streaming_state: completed and only the plan/task blocks, even though notifications briefly showed the text.
Cause
Once a stream has received chunks through chat.appendStream, Slack rejects later appends that use the markdown_text parameter with streaming_mode_mismatch. SlackAdapter.stream() (4.42.0 and 4.43.0) always sends text deltas as markdown_text: withSegmentPrefix(text) in sendDelta, including after sendStructuredChunk has appended chunks. No warning is logged on our side, and the text is lost.
Reproduction (Slack Web API, bot token)
chat.startStream { channel, thread_ts, recipient_user_id, recipient_team_id }→ okchat.appendStream { channel, ts, chunks: [{ type: "plan_update", title: "…" }, { type: "task_update", id: "t1", title: "…", status: "complete" }] }→ okchat.appendStream { channel, ts, markdown_text: "answer" }→{ ok: false, error: "streaming_mode_mismatch" }chat.stopStream→ ok; the message has only atask_cardblock.
Replacing step 3 with chat.appendStream { channel, ts, chunks: [{ type: "markdown_text", text: "answer" }] } works: the final message has task_card + rich_text.
Suggested fix
Once a segment has appended structured chunks, send text deltas as chunks: [{ type: "markdown_text", text }] instead of the markdown_text parameter (or always use chunk mode when structured chunks are enabled).
Versions
@chat-adapter/slack 4.42.0 (4.43.0 has the same sendDelta), chat 4.42.0, Node 26.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 329
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 62
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/chat
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 45/100
vercel/chat#1058 · 1 reaction ·
Maintainers usually reply within 1 day
-
Slack adapter: dispatch `app_uninstalled` / `tokens_revoked` to `onUninstalled`Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
Proposal: list zoom-chat-adapter as community adapter for Zoom Team ChatPossibly taken @aradhyacp claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
level/task type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wazuh/wazuh-dashboard-plugins#9508 ·
Maintainers usually reply within 1 day
-
Testnet EOL page links Zonescan mainnetPossibly taken @napelvs claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Azure-Samples/azure-search-openai-demo#3249 ·
Maintainers usually reply within 1 day
-
[Docs] docs/architecture.mermaid leaves out 21 of the 51 src/ directoriesPossibly taken @uyg7x claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
enhancement status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dongdongbh/Mindwtr#1438 ·
Maintainers usually reply within 1 day