How should custom data- parts stream with WorkflowAgent?

オープン
#5,377 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
46/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Start with the WorkflowAgent migration notes, the Streaming Updates from Tools documentation, and the createModelCallToUIChunkTransform implementation mentioned in the issue. Compare the transform behavior with workflow-examples PR #53 and investigate how stream parts relate to result.steps and WorkflowChatTransport reconnects. Done means documenting or implementing a supported way to stream, reconnect, and persist custom data parts, including those emitted outside tool calls.

索引モデルが issue の本文から書いたものです。

説明

We're moving a multi-turn agent from DurableAgent to WorkflowAgent (ai 7.0.163, @ai-sdk/workflow 2.0.95, workflow 5.4.0). We follow the chat-session-modeling and message-queueing docs: one long-lived run per chat, a hook feeding a queue, prepareStep draining it, and createModelCallToUIChunkTransform at the route.

Our workflow writes app-specific data-* parts to the run stream. Some come from inside tools, but many come from steps outside any tool call.

On DurableAgent they streamed live next to the model output. On WorkflowAgent, createModelCallToUIChunkTransform maps any part type it doesn't know to nothing, so they're dropped. We confirmed this in a test app and in the transform's source.

Questions:

  1. What's the recommended way to show custom data-* parts live with WorkflowAgent, including parts written from steps outside a tool call, so they also survive a reconnect with WorkflowChatTransport? Is passing data-* through the transform, as PR #53 does, supported?
  2. How do we save and persist these custom data parts? It’s not captured as part of the result.steps from WorkflowAgent.

What we've found:

  • The Streaming Updates from Tools page still says to write data-* chunks with getWritable() into the agent's stream. With the stock transform, those never reach the client.
  • The v7 migration notes say the stream moved to ModelCallStreamPart "to avoid baking a UI protocol into the workflow payload". They don't say where custom UI data should go instead.
  • workflow-examples PR #53 (flight-booking-app, closed without merging) copies the transform into lib/chat-stream.ts and forwards data-* parts unchanged.
  • eve and durable-harness sidestep the question. Neither uses WorkflowAgent: each runs ToolLoopAgent inside its own session runtime on Workflow 5 and writes its own event protocol to the run stream.
主要言語
TypeScript
スター
2.5k
フォーク
401
平均マージ
1日 21時間
マージ済み PR(30日)
201

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vercel/workflow のほかの issue

vercel/workflow の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。