Skip to content

Duplicate messages rendered in UI when writing custom data parts to the stream before calling agent.stream #975

@avi1989

Description

@avi1989

I have a workflow that reads data from various sources, streams them to the UI and then invokes the DurableAgent in a multi-chat workflow. I'm noticing that any messages that use the writable and are streamed before we invoke agent.stream are duplicated in the UI. The stream endpoint is only sending the data one time, but useChat is rendering them twice.
This issue has been happening since we upgraded WDK to 4.0.1-beta.49.

This can be reproduced by running flight-booking-app in my fork of vercel/workflow-examples.

I tried implementing the same changes with @workflow/ai 4.0.1-beta.48 and I did not see the duplicate message here

Screenshot without duplicate message
Image

Screenshot with duplicate message
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions