-
Notifications
You must be signed in to change notification settings - Fork 187
[core] Fix workflow runtime error normalization to avoid [object Promise] and preserve provider failure context
#989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: c345c9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (41 failed)turso (41 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | 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: Express | Nitro | Next.js (Turbopack) Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | 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: Express | Nitro | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
| expect(result.message).toContain('Step error message'); | ||
| // Stack trace contains function name and source file | ||
| expect(result.stack).toContain('errorStepFn'); | ||
| // Stack trace can show either the original step function or its transformed wrapper name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test was flaky, so i fixed it as part of this PR - it's unrelated to the changes made in this PR
PR Title
Fix workflow runtime error normalization to avoid
[object Promise]and preserve provider failure contextSummary
@workflow/core, including Promise/thenable throw/rejection cases.[object Promise]) with structured normalized errors in step/runtime failure handling.message/stackso provider errors (for example AI Gateway/Veo failures) remain readable and diagnosable.Why
Workflow retries were ending with opaque errors like
failed after 3 retries: [object Promise], which masked the actual provider failure reason and made o11y/debugging difficult.What changed (workflow package)
packages/core/src/types.tsnormalizeUnknownError(...)(async) to normalize:Errorpackages/core/src/runtime/step-handler.tsstep_retryingandstep_failedevent payloads/messages.packages/core/src/runtime.tsrun_failedworkflow-level failures.Behavior before vs after
[object Promise].Test plan
[object Promise]appears.step_retrying,step_failed, andrun_failedevents contain normalized error fields.Errorthrows in successful retry/failure flows.