Skip to content

[world-vercel] Fix HTTP stream append retries after 429 - #4828

Merged
alangenfeld merged 1 commit into
vercel:mainfrom
mmarufov:mmarufov/pasted-text-verification
Oct 12, 2026
Merged

alangenfeld merged 1 commit into
vercel:mainfrom
mmarufov:mmarufov/pasted-text-verification

Conversation

@mmarufov

@mmarufov mmarufov commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #4628.

After a 429, RetryAgent can reuse the body consumed by fetch, causing UND_ERR_REQ_CONTENT_LENGTH_MISMATCH. Retry stream appends above fetch using preserved bytes and the existing throttle budget and invocation deadline. Keeping global fetch preserves Vercel's outgoing-request observability.

Transport retries are limited to ECONNREFUSED, ENOTFOUND, EAI_AGAIN, and UND_ERR_CONNECT_TIMEOUT. This narrows the previous dispatcher policy: other network errors surface without replay. Stream close keeps its separate retry policy.

How did you test your changes?

  • The issue's unchanged repro fails on the PR base and passes with the fix on Node 24 and Bun.
  • Real HTTP/1.1 and TLS HTTP/2 tests verify complete-body retries. HTTP/1.1 also covers saved-then-500/reset failures, pagination, and custom dispatchers. Policy tests cover retry limits, throttle deadlines, and cancellation.
  • The full world-vercel suite, package build/typecheck, tracked-file Biome, and changeset validation pass locally. Full monorepo tests stop at missing Cargo.

PR Checklist - Required to merge

  • 📦 Patch changeset included for @workflow/world-vercel.
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits).
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete.

@mmarufov
mmarufov requested a review from a team as a code owner October 10, 2026 05:35
@changeset-bot

changeset-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 835047c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@workflow/world-vercel Patch
@workflow/cli Patch
@workflow/core Patch
@workflow/web Patch
workflow Patch
@workflow/world-testing Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt 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 Oct 10, 2026

Copy link
Copy Markdown
Contributor

@mmarufov is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@mmarufov mmarufov changed the title [world-vercel] Retry HTTP 429 stream appends with fresh requests [world-vercel] Fix HTTP stream append retries after 429 Oct 11, 2026
@mmarufov

Copy link
Copy Markdown
Contributor Author

@vercel/workflow ready for review. Could you approve the CI runs and preview deployments?

@vercel

vercel Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
workbench-astro-workflow Canceled Canceled v0 Oct 12, 2026 2:19am UTC

@alangenfeld

Copy link
Copy Markdown
Collaborator

Hey, thanks for the PR! First pass looks good to me, running CI. I expect this should get merged and included in a release this upcoming week.

Comment thread packages/world-vercel/README.md Outdated
Comment on lines +15 to +83
@@ -59,7 +80,7 @@ until the burst finishes. Call `releaseLock()` when finished contributing, not

## Custom dispatcher

HTTP requests (including the queue) default to a shared undici `RetryAgent` that handles connection pooling and retries. Pass a custom `dispatcher` to override it, for example, to tune undici on newer Node.js runtimes:
HTTP requests (including the queue) default to shared undici dispatchers for connection pooling, with retry policies specific to each operation. Pass a custom `dispatcher` to override them, for example, to tune undici on newer Node.js runtimes:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not sure we need these details in this readme

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! have trimmed the README, appreciate you setting up the CI mirror

@alangenfeld

Copy link
Copy Markdown
Collaborator

Ah I should have caught this before - we require verified signatures on commits for us to merge. Please squash + sign + force-push.

https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification

Signed-off-by: Muhammadjon Marufov <marufov254@gmail.com>
@mmarufov
mmarufov force-pushed the mmarufov/pasted-text-verification branch from 79889df to 835047c Compare October 12, 2026 19:45
@mmarufov

Copy link
Copy Markdown
Contributor Author

@alangenfeld Squashed into one signed commit and force-pushed, github shows it as verified now. Thanks!

@alangenfeld
alangenfeld merged commit 02993a2 into vercel:main Oct 12, 2026
5 of 23 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
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.

HTTP stream append retry after 429 reuses a consumed fetch body

2 participants