StreamProcessor drops TEXT_MESSAGE_CHUNK events without a warning
Maintainer thường phản hồi trong vòng 1 ngày
@AlemTuzlak đang làm issue này rồi.
Từ ngày 27/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
TanStack AI version
v0.61.0
Framework/Library version
React v19.2.0
Describe the bug and the steps to reproduce it
StreamProcessor has no handler for TEXT_MESSAGE_CHUNK. The event reaches
the default branch of processChunk and the processor drops it. There is no
warning.
AG-UI defines TEXT_MESSAGE_CHUNK as a short form of the
TEXT_MESSAGE_START / TEXT_MESSAGE_CONTENT / TEXT_MESSAGE_END triad. A
server can send one chunk event instead of three events. The AG-UI spec gives
the expansion job to the client stream transformer.
Two parts of this repository say that the event is supported:
packages/ai/src/types.tsdeclaresTextMessageChunkEventand puts it in
theAGUIEventunion. That union is the exportedStreamChunktype.packages/ai/src/utilities/spec-event-keys.tsgives the event an allowlist
entry, sostripToSpeckeepsmessageId,role,delta, andmetadata
at the top level.
The runtime does not match this. TOOL_CALL_CHUNK and
REASONING_MESSAGE_CHUNK have the same problem.
Steps to reproduce
live:
https://codesandbox.io/p/sandbox/hvf3mx
Open the sandbox. It needs no API key and makes no network calls. The AG-UI
events are constants in src/App.js.
- Build a
StreamProcessor. - Send
RUN_STARTED, then oneTEXT_MESSAGE_CHUNKwith amessageId, a
delta, and ametadata.error, thenRUN_ERROR. - Read
processor.getMessages(). - Do the same again with the explicit triad in place of the chunk event.
Result
The chunk event loses three things that the triad keeps:
| The server sent this, and the client | TEXT_MESSAGE_CHUNK | START / CONTENT / END |
|---|---|---|
shows the text "the run failed" |
lost | yes |
keeps the message id "msg-1" |
lost | yes |
keeps metadata.error |
lost | yes |
The assistant message is not absent. It is empty, and it has a new id:
[{ "id": "msg-1790507900666-2mxf4p", "role": "assistant", "parts": [] }]
RUN_ERROR created that message. The id msg-1 from the server is gone, so a
later event that uses msg-1 cannot find the message.
Expected result
Both forms describe the same turn. Both must produce the same message.
Notes
MESSAGES_SNAPSHOT is a plain messages[], so a reload of a saved thread
shows the correct text. The fault is visible only during a live run. A unit
test that sends the triad cannot find this fault.
processChunk already has the three handlers that an expansion needs. A
case per chunk event can call them, hold the open message id, and close the
message when the id changes or when finalizeStream runs.
Related: #1465 tried this and closed without a merge. #1460 added the AG-UI 1.0
types and left the runtime out of scope.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://codesandbox.io/p/sandbox/hvf3mx
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.1k
- Fork
- 340
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 175
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/ai
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
signin with openaiĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
update elevenlabsCó thể đã có người làm @tombeckenham đã nhận 1 ngày trước. Đang mởhas-pr waiting-on: maintainer
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
TanStack/ai#1564 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
onAfterToolCall failure records a second, contradictory result for a successful server toolCó thể đã có người làm @AlemTuzlak đã nhận 1 ngày trước. Đang mởhas-pr waiting-on: maintainer
TanStack/ai#1558 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SSE and NDJSON response streams drain unread sources without backpressureCó thể đã có người làm @tombeckenham đã nhận 1 ngày trước. Đang mởhas-pr waiting-on: maintainer
TanStack/ai#1556 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Dream TR SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
SocialGouv/egapro#4672 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:agents area:tui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
anthropics/claude-code#98358 ·
Maintainer thường phản hồi trong vòng 1 ngày