Skip to content

Backport #2699: fix(ai): recover from invalid tool-call input instead of aborting the agent stream#2703

Merged
VaguelySerious merged 2 commits into
stablefrom
backport/pr-2699-to-stable
Jul 1, 2026
Merged

Backport #2699: fix(ai): recover from invalid tool-call input instead of aborting the agent stream#2703
VaguelySerious merged 2 commits into
stablefrom
backport/pr-2699-to-stable

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated backport of #2699 to stable (backport job run).

AI recommendation: This is a self-contained bug fix to executeTool in packages/ai/src/agent/durable-agent.ts, which exists on stable with the same throw parseError; behavior being fixed (verified at line 1654 on origin/stable). The change makes invalid tool-call input recoverable instead of aborting the stream, adds regression tests, and does not depend on any main-only APIs, so it applies cleanly to stable.

… agent stream (#2699)

In-repo copy of #2192 by @boomyao, opened to run the full CI suite.

Co-authored-by: yao <zhangyaoruo@outlook.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 25f21a9

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

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 1, 2026 12:02am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 1, 2026 12:02am
example-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-astro-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-express-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-fastify-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-hono-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-nitro-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workbench-vite-workflow Ready Ready Preview, Comment Jul 1, 2026 12:02am
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:02am
workflow-swc-playground Ready Ready Preview, Comment Jul 1, 2026 12:02am
workflow-tarballs Ready Ready Preview, Comment Jul 1, 2026 12:02am
workflow-web Ready Ready Preview, Comment Jul 1, 2026 12:02am

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1077 0 78 1155
✅ 💻 Local Development 1174 0 86 1260
✅ 📦 Local Production 1174 0 86 1260
✅ 🐘 Local Postgres 1162 0 98 1260
✅ 🪟 Windows 105 0 0 105
❌ 🌍 Community Worlds 79 102 9 190
✅ 📋 Other 592 0 38 630
Total 5363 102 395 5860

❌ Failed Tests

🌍 Community Worlds (102 failed)

redis (19 failed):

  • hookWorkflow | wrun_01KWFMBB5X7VB9ESJRYWBSPR0K
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KWFMBHQDGR363ESVXTNZY5NC
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KWFMBSFZVXXZP3677P8YRYBV
  • sleepingWorkflow | wrun_01KWFMCRNV3XSXV6PRJMMKFFM2
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KWFMM61E2K1XC88AADJR0BNM
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KWFMMGVZB5XMDYC10WFVJ9QN
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KWFMMQFQ3AHWCE67H3BVJA8M
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KWFMN5DJPM0JQ6KWK14343SR
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KWFMNZMNJ6B3Y8N5JD0XTM3K
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KWFMP4D2KAJTS576Q3X4TAW5
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KWFMP9MJWPSFWZ5SK9TW8BQX
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KWFMPF8CMWSQPBSNBVHD0HFR
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KWFMPQQMJWT7VF186THZ47RX
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KWFMW1C9JEPVJKYQES2XF5EA

turso (83 failed):

  • addTenWorkflow | wrun_01KWFMAD5XYBYEC40E7ACBFKWG
  • addTenWorkflow | wrun_01KWFMAD5XYBYEC40E7ACBFKWG
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KWFMAHSPX2766XH0S4D0BB6R
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KWFMAMVRCAH0R409VRT66GN0
  • promiseRaceWorkflow | wrun_01KWFMATSYCJAC60NQCKNNBSMX
  • promiseAnyWorkflow | wrun_01KWFMAXE85CMTE8T42H4F2E26
  • importedStepOnlyWorkflow | wrun_01KWFMAZ0Y453YQZN8WVGWHDGY
  • readableStreamWorkflow | wrun_01KWFMAZF2Q84CDS51J0XCZDCG
  • hookWorkflow | wrun_01KWFMBB5X7VB9ESJRYWBSPR0K
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KWFMBHQDGR363ESVXTNZY5NC
  • webhookWorkflow | wrun_01KWFMBNFFJ3E8QR77DXRJ968D
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KWFMBSFZVXXZP3677P8YRYBV
  • sleepingWorkflow | wrun_01KWFMCRNV3XSXV6PRJMMKFFM2
  • parallelSleepWorkflow | wrun_01KWFMD82S5TF0Q4728Z8RN39S
  • sleepWinsRaceWorkflow | wrun_01KWFMDB6G3EPHKX2GDC9YCGG2
  • stepWinsRaceWorkflow | wrun_01KWFMDED2B9Q6GKNRP3PYCG79
  • nullByteWorkflow | wrun_01KWFMDHJ3GKFD3XHZSKNWFGRK
  • workflowAndStepMetadataWorkflow | wrun_01KWFMDKK00RF62GRKM6XF7SV0
  • outputStreamWorkflow no startIndex (reads all chunks)
  • outputStreamWorkflow positive startIndex (skips first chunk)
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions | wrun_01KWFMFW8ZQD1HSN34VFFG0ZCJ
  • writableForwardedFromWorkflowWorkflow | wrun_01KWFMG9T5FMSSSDMXMX2RKC89
  • writableForwardedFromStepWorkflow | wrun_01KWFMGE7Q7H3C47MRWQMYC4B8
  • fetchWorkflow | wrun_01KWFMGHHSRJWFHP2MJJEHX1EC
  • promiseRaceStressTestWorkflow | wrun_01KWFMGMKSSWVMAYT55FW2YB8P
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • error handling not registered WorkflowNotRegisteredError fails the run when workflow does not exist
  • error handling not registered StepNotRegisteredError fails the step but workflow can catch it
  • error handling not registered StepNotRegisteredError fails the run when not caught in workflow
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KWFMKTD3VZ6AXDXE3E3NN04S
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KWFMM61E2K1XC88AADJR0BNM
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KWFMMGVZB5XMDYC10WFVJ9QN
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KWFMMK6MMTWMJ4T7RFZHAYVA
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KWFMMNBN5HRS4RE3BQNWSBJR
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KWFMMQFQ3AHWCE67H3BVJA8M
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KWFMN5DJPM0JQ6KWK14343SR
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KWFMNZMNJ6B3Y8N5JD0XTM3K
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KWFMP4D2KAJTS576Q3X4TAW5
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KWFMP9MJWPSFWZ5SK9TW8BQX
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KWFMPF8CMWSQPBSNBVHD0HFR
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KWFMPQQMJWT7VF186THZ47RX
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KWFMPZ3KYJYV5Z77JYMSXHBN
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KWFMQCZ17RHK1SNS5Q0MJMNK
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KWFMQN4FAWD06BBZ9A9588SV
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KWFMQT9VWB15GE4H9HDTDBV4
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KWFMQW7NM3DP4S6WYFPV3DEM
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KWFMRAXDVH07EPJZ1V2R6YRD
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KWFMRG2ZAJR7AP4MV2891H02
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KWFMRPJBFNMGYJBAKD8R7YV1
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KWFMRWVRKSGKN8NT2G5T5769
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KWFMS39SXVDQTXE2194SAXTQ
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KWFMSAPH7TJM54FPP2GFBARX
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KWFMSGTM40HW0Y7R8XXMY329
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KWFMSXAYDGQ5GDXWGMWDFB24
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KWFMT5Z80EFB6HDH3K3ZDSZC
  • cancelRun - cancelling a running workflow | wrun_01KWFMTC877KDSQZ8GPJJHW0S3
  • cancelRun via CLI - cancelling a running workflow | wrun_01KWFMTGHS0BSXD3V2S64QA77N
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KWFMTQEVWE2QK20DXMGP88DT
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01KWFMV2H00SHFHVAVQJ191GQ0
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KWFMVAK7CEGR0QRPFHK2GGXR
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KWFMVNMXBRKG5X5Q82P17CMY
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KWFMVX27MJ4ER45NS59WWJMA
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KWFMVZ9VMXZYEQ26PHXTN9AD
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KWFMW1C9JEPVJKYQES2XF5EA

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 97 0 8
✅ example 97 0 8
✅ express 97 0 8
✅ fastify 97 0 8
✅ hono 97 0 8
✅ nextjs-turbopack 102 0 3
✅ nextjs-webpack 102 0 3
✅ nitro 97 0 8
✅ nuxt 97 0 8
✅ sveltekit 97 0 8
✅ vite 97 0 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
✅ sveltekit-stable 99 0 6
✅ vite-stable 99 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
✅ sveltekit-stable 99 0 6
✅ vite-stable 99 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 98 0 7
✅ express-stable 98 0 7
✅ fastify-stable 98 0 7
✅ hono-stable 98 0 7
✅ nextjs-turbopack-canary 85 0 20
✅ nextjs-turbopack-stable 104 0 1
✅ nextjs-webpack-canary 85 0 20
✅ nextjs-webpack-stable 104 0 1
✅ nitro-stable 98 0 7
✅ nuxt-stable 98 0 7
✅ sveltekit-stable 98 0 7
✅ vite-stable 98 0 7
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 105 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 3
✅ redis-dev 3 0 3
❌ redis 67 19 0
✅ turso-dev 3 0 3
❌ turso 3 83 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 99 0 6
✅ e2e-local-dev-tanstack-start-stable 99 0 6
✅ e2e-local-postgres-nest-stable 98 0 7
✅ e2e-local-postgres-tanstack-start-stable 98 0 7
✅ e2e-local-prod-nest-stable 99 0 6
✅ e2e-local-prod-tanstack-start-stable 99 0 6

📋 View full workflow run

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.

1 participant