Backport #3564: Verify stream completion on clean EOF in the reconnecting framed reader - #3588
Open
github-actions[bot] wants to merge 1 commit into
Open
Backport #3564: Verify stream completion on clean EOF in the reconnecting framed reader#3588github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…er (#3564) Long live reads were ending silently at the server's 2-minute connection cap: the max-duration abort reaches the client as a clean EOF on some transport paths, and the reader read that as end-of-stream. On EOF it now consults `streams.getInfo` and reconnects from the next chunk unless the stream is done and every chunk up to the tail was delivered. A failed metadata read trusts the EOF, so a transient blip can't fail a healthy completion. Tests added for the reconnect, verified-completion, metadata-failure, and reconnect-budget paths. --------- Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com> Signed-off-by: Alex Langenfeld <alexlangenfeld@gmail.com>
🦋 Changeset detectedLatest commit: ff5613e The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated backport of #3564 to
stable(backport job run).AI recommendation: This is a data-loss/correctness fix:
createReconnectingFramedStreamtrusted a clean EOF as end-of-stream, so long live reads were silently truncated when the server's max-duration abort arrived as a graceful close. The buggy code exists verbatim onstable(packages/core/src/serialization.ts:691, including the "Clean EOF — stream is truly complete" branch), andstablehas an equivalent metadata API (World.getStreamInfo(name, runId)returning{ tailIndex, done }) the fix can use, though the call site differs from main'sworld.streams.getInfo(runId, name)and will need adapting. Changeset is apatchto@workflow/coreand the only other file is an accompanying test.Merge conflicts were resolved by AI (opencode with
anthropic/claude-opus-5). Please review the conflict resolution carefully before merging.