Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Slack stream: text after plan/task chunks is rejected with streaming_mode_mismatch and lost

Open
#1,074 0 comments 0 reactions 0 assignees View on GitHub

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
Domain
api, backend

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)
  1. chat.startStream { channel, thread_ts, recipient_user_id, recipient_team_id } → ok
  2. chat.appendStream { channel, ts, chunks: [{ type: "plan_update", title: "…" }, { type: "task_update", id: "t1", title: "…", status: "complete" }] } → ok
  3. chat.appendStream { channel, ts, markdown_text: "answer" } → { ok: false, error: "streaming_mode_mismatch" }
  4. chat.stopStream → ok; the message has only a task_card block.

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel/chat

All issues in vercel/chat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.