How should custom data- parts stream with WorkflowAgent?

Đang mở
#5,377 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
46/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
TypeScript
Star
2.5k
Fork
401
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
201

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vercel/workflow

Tất cả issue của vercel/workflow

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.