fix(core): fail runs delivered to the wrong deployment#2944
Closed
alangenfeld wants to merge 1 commit into
Closed
Conversation
🦋 Changeset detectedLatest commit: c0b46d5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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
|
Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
alangenfeld
force-pushed
the
alangenfeld/fail-cross-deployment-runs
branch
3 times, most recently
from
July 15, 2026 23:15
c4770b1 to
c3b4b0b
Compare
Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
alangenfeld
force-pushed
the
alangenfeld/fail-cross-deployment-runs
branch
from
July 16, 2026 00:17
c3b4b0b to
c0b46d5
Compare
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.
Summary
A run created on one deployment whose queue callbacks route to another (common on preview branches, where a superseded deployment is deactivated) fails cryptically: the step handler resolves the per-run encryption key from the bare
runId, derives it from the wrong deployment's master key, and throws aRuntimeDecryptionErrorbefore user code runs. The queue retry callback swallows it, so the run dies as a blank "exceeded max retries."A run may only execute on the deployment that created it (continuing elsewhere risks code skew). This detects delivery to the wrong deployment and fails the run with the new
DEPLOYMENT_MISMATCHerror code.errorCodeis what observability and the UI key off (describeRunErrormaps it to an actionable hint).RUN_ERROR_CODES.DEPLOYMENT_MISMATCH;WorkflowDeploymentMismatchErrorclassifies to it.Closes #2816.
Follow-ups (not in this PR)
DEPLOYMENT_MISMATCHto a docs page.world-vercel's queue retry callback (the issue's second problem — general diagnosability, orthogonal to this fix).Testing
pnpm --filter @workflow/core... buildpnpm --filter @workflow/core exec vitest run src --exclude src/vm/uint8array-base64.test.ts(1,430 tests)pnpm --filter @workflow/errors test(38 tests)The excluded VM test has existing cross-realm assertion failures on local Node 26; the repository supports through Node 24.