StreamProcessor discards metadata from REASONING_MESSAGE_START
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- TypeScript
- スター
- 3.2k
- フォーク
- 365
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 261
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/ai のほかの issue
-
withPersistence does not save activity rows when a run is stopped or fails対応中かも @tombeckenham が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
Activity events that a chat middleware emits are streamed but never recorded or persisted対応中かも @AlemTuzlak が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
withPersistence stores the durability batch hint on a stopped or failed assistant message対応中かも @tombeckenham が 1 日前に担当しました。 オープンhas-pr waiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
Activity events that a chat middleware emits are streamed but never recorded or persisted対応中かも @AlemTuzlak が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
-
withPersistence stores the durability batch hint on a stopped or failed assistant message対応中かも @tombeckenham が 1 日前に担当しました。 オープンwaiting-on: maintainer
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jbacalso24/mimry#459 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
architecture help wanted hive/claimed-by-architect origin/architect stage/030-pr-in-progress tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kubestellar/console#24422 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: backends type: docs
難易度 1/5 1〜3時間 初心者へのやさしさ 83/100
schlessera/brain-kit#2383 ·
メンテナーはふだん 1 日以内に返信
-
agent duplicate providers tool triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信