Skip to content

Conversation

@avi1989
Copy link

@avi1989 avi1989 commented Dec 31, 2025

This is a fix for #709.

The issue was that when importing @workflow/ai, durable agent pulls in dependencies from @workflow/core which cannot be bundled for client components.

This PR introduces a dedicated export path @workflow/ai/transport that exports only WorkflowChatTransport and its types. This isolates it from server-only dependencies.

I've also tried to update any reference in the docs and updated it. Let me know if there is anything else I need to do.

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2025

🦋 Changeset detected

Latest commit: 54285d2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@workflow/ai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Dec 31, 2025

@avi1989 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@pranaygp
Copy link
Collaborator

pranaygp commented Jan 1, 2026

hm I don't like adding another path for the export - /transport (and /agent is already) not ideal IMO

We already only export DurableAgent from /agent so we shouldn't be including server side code when importing @workflow/ai client side.

related: I previously killed this #209 (comment)

Would prefer doing conditional imports here - workflow supports "workflow" as a conditional exports, so we could do separate conditional export to make DurableAgent only work in workflow context, and throw an error when imported in browser/node contexts

@pranaygp pranaygp requested a review from TooTallNate January 1, 2026 05:03
@pranaygp
Copy link
Collaborator

pranaygp commented Jan 1, 2026

cc @TooTallNate for vis ☝🏼

@pranaygp
Copy link
Collaborator

pranaygp commented Jan 1, 2026

ahh it looks like this was caused recently by #668

@TooTallNate
Copy link
Member

TooTallNate commented Jan 1, 2026

Right, so that's why DurableAgent was specifically only under the @workflow/ai/agent sub-export before. #668 should not have re-exported. It was an oversight that that change made it through.

So I suppose the question we need to answer is which interface do we want at the root-level interface vs. which one is in the sub-export.

I wonder if it would be possible to make DurableAgent be a stub when bundling client-side, maybe browser condition? We'd need to verify if that works with the supported web frameworks though.

@TooTallNate
Copy link
Member

#714 is a simpler fix and aligned with how it was configured before and what the docs say.

@pranaygp pranaygp closed this in #714 Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants