StreamProcessor drops TEXT_MESSAGE_CHUNK events without a warning
Los mantenedores suelen responder en 1 día
@AlemTuzlak ya está trabajando en esto.
Desde el 27/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.1k
- Forks
- 340
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 174
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/ai
-
StreamProcessor ignores the stream's message ids and files agent-loop calls on the wrong assistant messagePosiblemente ocupada @tombeckenham la tomó hace 1 día. Abiertowaiting-on: maintainer
TanStack/ai#1533 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
feat(ai): add a timeout option to chat(), matching the media activitiesPosiblemente ocupada @AlemTuzlak la tomó hace 2 días. Abiertowaiting-on: maintainer
TanStack/ai#1517 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Does a hosted provider package have to carry a key?Posiblemente ocupada @AlemTuzlak la tomó hace 3 días. Abiertowaiting-on: author
TanStack/ai#1506 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Client tools never execute against spec-compliant AG-UI servers (plain `success` RUN_FINISHED)Posiblemente ocupada @jherr la tomó hace 5 días. Abiertowaiting-on: maintainer
TanStack/ai#1464 · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add ai to awesome-ai-plugins?Posiblemente ocupada @tombeckenham la tomó hace 11 días. Abiertowaiting-on: maintainer
TanStack/ai#1382 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/ai
Issues similares
-
triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mermaid-js/mermaid-live-editor#2053 ·
Los mantenedores suelen responder en 1 día
-
factory
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
jessepollak/home#1455 ·
Los mantenedores suelen responder en 1 día
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
lingdojo/kana-dojo#31227 · 1 comentario · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
mobile: device viewer shows dark status bar icons on its dark backdrop in light mode (Android)Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
appandflow/stim#1838 ·
Los mantenedores suelen responder en 1 día