[ai] Fix fatal stream errors surfacing as [object Object]#1589
[ai] Fix fatal stream errors surfacing as [object Object]#1589VaguelySerious merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (60 failed)mongodb (3 failed):
redis (2 failed):
turso (55 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
🦋 Changeset detectedLatest commit: 9076035 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 10 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express workflow with 25 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 50 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 10 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 25 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 50 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express stream pipeline with 5 transform steps (1MB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) 10 parallel streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) fan-out fan-in 10 streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
Replace String(error) with getErrorMessage() that prefers error.message, falls back to JSON.stringify for plain objects, avoiding the [object Object] pitfall. Extract shared utility from durable-agent.ts and use it in do-stream-step.ts and workflow-chat-transport.ts. Closes #1545 Signed-off-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Wielander <mittgfu@gmail.com>
2cdfc4e to
9076035
Compare
karthikscale3
left a comment
There was a problem hiding this comment.
AI review: Approve — correct fix, well-scoped, low regression risk.
-
Complete coverage: Both
String(error)call sites in@workflow/aiare fixed. The existinggetErrorMessageindurable-agent.tsis properly deduplicated into the shared utility. -
Integration test is fragile: The reconnection error formatting test does a second
reader.read()after the reader is already in an error state — the assertion may not execute reliably. The unit tests ongetErrorMessageitself are solid though. -
Edge case:
JSON.stringifycan throw on circular references. Matches AI SDK's owngetErrorMessagebehavior so it's consistent, but atry/catchfallback would be more defensive.
…1-refresh * origin/main: (21 commits) Fix node-module-error plugin matching identifiers in multi-line comments (#1554) fix(swc-plugin): use binding name for class expression method registrations (#1599) fix(builders): override `sideEffects: false` for discovered workflow/step/serde entries (#1598) [world-vercel] align header names to `x-vercel-workflow-*` convention (#1602) [docs] Add vercel world consumer function security documentation (#1543) Make `start()` types `unknown` when `deploymentId` is provided (#1367) fix(next): stop force-setting WORKFLOW_PUBLIC_MANIFEST=1 during next dev (#1597) Version Packages (beta) (#1593) [docs] Tidy world API docs and document new stream helpers (#1581) Rename 'Workflow Development Kit' / 'DevKit' to 'Workflow SDK' (#1595) [world] Use zod/v4 in queue files to match @workflow/world schemas (#1588) [ai] Fix fatal stream errors surfacing as [object Object] (#1589) [web] Fix server crash on unmatched routes (#1590) docs: rename 'Complex Example' to 'Instance Methods as Steps' (#1592) Version Packages (beta) (#1563) [core] Extend flow route duration to "max" and fail runs where replay takes too long (#1567) fix: check target run capabilities before encrypting hook payloads (#1572) [core] Combine initial run fetch, event fetch, and run_started event creation (#1569) [docs] Split World API docs into sub-pages, update skill.md (#1457) [nitro] Preserve workflow step registration side effects (#1386) ... # Conflicts: # skills/workflow/SKILL.md
Summary
Closes #1545
getErrorMessage()utility that preferserror.message, thenJSON.stringify()for plain objects, avoiding theString(error)→[object Object]pitfallString(error)indo-stream-step.ts(error chunk serialization) andworkflow-chat-transport.ts(reconnection error message)getErrorMessagefromdurable-agent.tsin favor of the shared utilityTest plan
getErrorMessagecovering Error instances, strings, plain objects, null/undefined, arraysWorkflowChatTransportreconnection error formattingdo-stream-stepandworkflow-chat-transporttests pass🤖 Generated with Claude Code