Commit 0527ee3
authored
fix(node): Preserve synchronous return behavior for streamText and other methods for AI (#17580)
Vercel AI integration was incorrectly wrapping all patched methods in an
async function, causing synchronous methods like streamText to return
Promises when they should return synchronous objects.
```
// Before
const result = streamText({model: "gpt-5"});
console.log(result);
```
```
// After
const result = streamText({model: "gpt-5"});
console.log(result); // DefaultStreamTextResult { ... } ✅
```
Resolves: #175531 parent f742746 commit 0527ee3
File tree
1 file changed
+11
-5
lines changed- packages/node/src/integrations/tracing/vercelai
1 file changed
+11
-5
lines changedLines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
239 | | - | |
| 240 | + | |
240 | 241 | | |
241 | | - | |
| 242 | + | |
242 | 243 | | |
243 | | - | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
| 250 | + | |
| 251 | + | |
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
| |||
0 commit comments