You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use vercelRunOutcome in Vercel AI SDK Core framework guide
The agent route snippets piped the stream and called run.end({ reason })
directly, skipping vercelRunOutcome. This diverged from the getting started
guide and the 0.2.0 blog post, and dropped tool-call suspension and the
finishReason rejection guard. Align both snippets and the explanation with
the canonical pattern.
Fixes AIT-1034
@@ -95,7 +102,7 @@ The integration has three pieces:
95
102
96
103
1. The `UIMessageCodec` encodes Vercel's `UIMessageChunk` events as Ably messages. Every chunk type maps to an Ably operation with headers that track the metadata. The codec encodes on the agent and decodes on the client.
97
104
2.`createAgentSession({ client, channelName })` from `@ably/ai-transport/vercel` constructs the agent session bound to the channel from the invocation. The default codec is `UIMessageCodec`.
98
-
3.`run.pipe()` reads the model's `UIMessageChunk` stream, encodes each chunk, and publishes the resulting Ably messages. `run.abortSignal` wires cancellation through from the client.
105
+
3.`run.pipe()` reads the model's `UIMessageChunk` stream, encodes each chunk, and publishes the resulting Ably messages. `run.abortSignal` wires cancellation through from the client.[`vercelRunOutcome()`](/docs/ai-transport/api/javascript/vercel/run-outcome) then maps the pipe result and Vercel's `finishReason` to the right lifecycle action: suspend the Run when the model requested tools the SDK did not auto-execute, otherwise end it with the matching reason.
0 commit comments