StreamProcessor discards metadata from REASONING_MESSAGE_START
Los mantenedores suelen responder en 1 día
@tombeckenham ya está trabajando en esto.
Desde el 9/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
TanStack AI version
@tanstack/ai 0.66.0, installed from npm in an isolated directory.
The same behavior also occurs on main commit 96191eafee12040c78f849fe7d47220f64591684.
Framework/Library version
Node.js 26.6.0, with a bare StreamProcessor.
The reproduction does not need React, a provider, or an API key.
Describe the bug and the steps to reproduce it
Custom metadata on REASONING_MESSAGE_START does not survive conversion into a UIMessage.
The thinking text appears, but the resulting message has no metadata.
The reproduction uses one root run.
It compares the same metadata on two events:
- On
REASONING_MESSAGE_START: the metadata is lost. - On
REASONING_MESSAGE_CONTENT: the metadata is preserved.
Expected
The metadata remains available after processing the reasoning stream, consistently with the content-event case.
Actual
UIMessage.metadata is undefined when only the start event carries the metadata.
Steps
- Download the files from the reproduction gist.
- Run
npm install --ignore-scripts --no-audit --no-fund. - Run
npm run metadata.
The script first checks the content-event control.
That check passes.
The assertion for the start event then fails:
Metadata on START: undefined
Metadata on CONTENT: { source: 'reasoning', traceId: 'trace-1' }
AssertionError [ERR_ASSERTION]: Metadata on reasoning start is lost
Source
The dispatcher ignores REASONING_MESSAGE_START.
The content handler only merges metadata from the content event.
Please clarify the intended destination for reasoning-start metadata: the owning UIMessage or its ThinkingPart.
At present, neither exposes it.
Related issue
#1533 concerns reasoning ownership across different messages.
This report isolates metadata loss in one run.
Our local workaround copies the metadata onto reasoning content events.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
Complete runnable reproduction: metadata.mjs, package.json, and instructions
The package version is pinned to 0.66.0.
The second script in the gist provides an additional reproduction for #1533.
Screenshots or Videos (Optional)
No screenshot is needed for this framework-independent reproduction.
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging.
No PR accompanies this report.
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct.
- I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.2k
- Forks
- 361
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 210
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
-
summarize() sends temperature 0.3 to models that reject sampling parameters (e.g. claude-sonnet-5-5)Posiblemente ocupada @jherr la tomó hace 2 días. Abiertohas-pr waiting-on: maintainer
TanStack/ai#1703 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-openrouter: malformed Chat Completions tool arguments execute as an empty objectPosiblemente ocupada @tombeckenham la tomó hace 3 días. Abiertohas-pr waiting-on: maintainer
TanStack/ai#1689 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Async persistence restored before attach() never rejoins an in-flight runPosiblemente ocupada @tombeckenham la tomó hace 6 días. Abiertohas-pr waiting-on: maintainer
TanStack/ai#1639 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
`ai-opencode`: `RUN_FINISHED` never arrives when an adapter teardown step does not settlePosiblemente ocupada @tombeckenham la tomó hace 6 días. Abiertowaiting-on: maintainer
TanStack/ai#1638 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
ai-mcp: support publishing MCP list changes to subscribed clientsPosiblemente ocupada @jherr la tomó hace 6 días. Abiertowaiting-on: maintainer
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
TanStack/ai#1631 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/ai
Issues similares
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
alunduil/projects-v2-sync#21 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
testcontainers/testcontainers-node#1539 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
christopher-buss/eslint-plugin-flawless#72 ·
Los mantenedores suelen responder en 1 día
-
cleanName keeps a state code that's joined to the word before it (SavannahGa → "Savannah Ga")Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openwatersio/slackwater-database#281 ·
Los mantenedores suelen responder en 1 día