Backport #1853: [core] Add wire-level framing for byte streams#2380
Merged
Conversation
Co-authored-by: Peter Wielander <peter.wielander@vercel.com> Co-authored-by: Peter Wielander <mittgfu@gmail.com> Signed-off-by: Nathan Rajlich <n@n8.io>
🦋 Changeset detectedLatest commit: 1094d35 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 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
…-beta.15'` on the `stable` (4.x) branch, so the gate is always `false` and the feature is dead code on every stable run.
This commit fixes the issue reported at packages/core/src/capabilities.ts:88
## Bug
In `packages/core/src/capabilities.ts`, the `CAPABILITY_VERSION_TABLE` gated `framedByteStreams` on:
```ts
}> = [{ capability: 'framedByteStreams', minVersion: '5.0.0-beta.15' }];
```
`getRunCapabilities()` enables the capability via `semver.gte(workflowCoreVersion, minVersion)`. `workflowCoreVersion` is the run's recorded `@workflow/core` version, generated from `package.json`.
This is a **backport of #1853 to the `stable` branch**:
- `packages/core/package.json` → `"version": "4.4.0"`
- `.changeset/byte-stream-wire-framing.md` is a `minor` bump for `@workflow/core` → next stable release is `4.5.0`
Every run on the stable line therefore records a `4.x.y` version. For any `4.x.y`, the major version `4 < 5`, so `semver.gte('4.x.y', '5.0.0-beta.15')` is **always `false`**. The capability can never become `true` on stable.
### Manifestation / trigger
For any run created on the stable line (concrete trigger: a run with recorded version e.g. `4.5.0`):
- `resume-hook.ts` passes `capabilities.framedByteStreams` → always `false` → resume payloads never frame.
- Cross-deployment `start()` in `start.ts` probes the target version, sees `4.x` → `false` → writes raw bytes.
So the backported capability detection is silently inert; framing only ever activates on the hardcoded-`true` paths (same-deployment start, step return values, getWritable). This is a functional gap (not data corruption — a too-high cutoff is the "safe" direction per the table's `TODO(release)` comment), but it makes the cross-deployment/resume framing path dead code on stable.
## Fix
Set the cutoff to the actual stable release version that ships this change:
```ts
}> = [{ capability: 'framedByteStreams', minVersion: '4.5.0' }];
```
Also updated the `## History` doc comment (`added in 4.5.0`) and the version-gate unit tests in `capabilities.test.ts`, which were still written against the v5 beta cutoff and would otherwise fail:
- pre-framing (false): `4.2.0-beta.64`, `4.2.0`, `4.4.0`, `4.5.0-beta.14`
- exact cutoff (true): `4.5.0`
- post-framing (true): `4.5.1`, `4.6.0`, `5.0.0`, `6.0.0`
These are consistent with semver semantics (a prerelease like `4.5.0-beta.14` is `< 4.5.0`, and all `>= 4.5.0` including future majors satisfy the gate).
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
Contributor
Author
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (97 failed)redis (18 failed):
turso (79 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
VaguelySerious
requested changes
Jun 12, 2026
VaguelySerious
left a comment
Member
There was a problem hiding this comment.
need to fix version numbers
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
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 #1853 to
stable(backport job run).AI recommendation: Self-contained minor feature in
@workflow/corewhose prerequisites all exist onstable: I verifiedcapabilities.ts,healthCheck()withworkflowCoreVersion(the #1854 dependency),serialization.ts, and the related object-stream reconnect infrastructure (reconnecting-framed-stream) are all present onorigin/stable. It also lays groundwork for byte-stream auto-reconnect, complementing the reconnect work already onstable(#1847). Note for reviewers: theframedByteStreamscapability cutoff is5.0.0-beta.15(amain-only version), so a stable backport should adjust theminVersionto the appropriate 4.x release; main'sserialization/types.tschanges also need mapping onto stable's single-fileserialization.tslayout.Merge conflicts were resolved by AI (opencode with
anthropic/claude-fable-5). Please review the conflict resolution carefully before merging.