[cli] [core] Probe deployment specVersion before CLI start#1629
Merged
VaguelySerious merged 17 commits intomainfrom Apr 7, 2026
Merged
[cli] [core] Probe deployment specVersion before CLI start#1629VaguelySerious merged 17 commits intomainfrom
VaguelySerious merged 17 commits intomainfrom
Conversation
Bump SPEC_VERSION_CURRENT to 3 and fix isLegacySpecVersion to check against SPEC_VERSION_LEGACY instead of SPEC_VERSION_CURRENT, preventing v2 runs from being incorrectly treated as legacy when the version bumps. Add JsonTransport and DualTransport to world-vercel queue: the handler uses DualTransport (CBOR-first, JSON fallback) to accept messages from both old and new deployments, while the send path selects CBOR or JSON based on the target run's specVersion. Pass specVersion through queue opts from start(), reenqueueRun(), wakeUpRun(), and resumeHook(). Only include runInput in the queue payload for specVersion >= 3, creating clean separation between old and new behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump specVersion to 3. Use JSON transport for queue messages targeting older deployments (specVersion < 3), CBOR for new ones. Handler uses dual transport that deserializes both formats, so new deployments can receive messages from old and new senders. Fixes replay/reenqueue from the dashboard to older deployments that expect JSON queue messages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace SPEC_VERSION_CURRENT comparisons with named constants (SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_EVENT_SOURCING) so future SPEC_VERSION_CURRENT bumps don't shift existing feature gates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace hardcoded specVersion: 2 with SPEC_VERSION_CURRENT so the test tracks spec version bumps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both the HTTP health check endpoint (?__health) and the queue-based health check stream now return specVersion, allowing observability tools to query deployment capabilities. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
…d, causing `toEqual` to fail due to exact equality mismatch.
This commit fixes the issue reported at packages/core/e2e/e2e.test.ts:1550
**Bug explanation:**
The `withHealthCheck` handler in `packages/core/src/runtime/helpers.ts` returns a JSON response with three fields: `{ healthy: true, endpoint: url.pathname, specVersion: SPEC_VERSION_CURRENT }`. However, the HTTP-based health check e2e test in `packages/core/e2e/e2e.test.ts` (lines 1549-1553 and 1567-1571) uses `toEqual` to assert against objects that only have two fields: `{ healthy: true, specVersion: SPEC_VERSION_CURRENT }`, missing the `endpoint` field.
In Vitest, `toEqual` performs exact deep equality checking. When the actual response object contains `{ healthy: true, endpoint: "/.well-known/workflow/v1/flow", specVersion: "..." }` but the expected object only has `{ healthy: true, specVersion: "..." }`, the assertion fails because the actual object has an extra `endpoint` property not present in the expected object.
This affects both the flow endpoint health check assertion and the step endpoint health check assertion.
**Fix explanation:**
Added the missing `endpoint` field to both `toEqual` assertions:
- For the flow endpoint: `endpoint: '/.well-known/workflow/v1/flow'` (the pathname portion of `/.well-known/workflow/v1/flow?__health`)
- For the step endpoint: `endpoint: '/.well-known/workflow/v1/step'` (the pathname portion of `/.well-known/workflow/v1/step?__health`)
These values match what `url.pathname` returns in the handler (the `?__health` query parameter is not part of the pathname). This makes the test assertions exactly match the actual response structure from the handler.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: VaguelySerious <mittgfu@gmail.com>
Update HealthCheckResult to include specVersion and parse it from the stream response, so observability tools can query deployment capabilities through both the HTTP and queue-based health check paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Record<string, unknown> instead of narrower casts that tsc rejects as insufficient overlap. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI start command now queries the deployment's health check endpoint to determine its specVersion before calling start(). This ensures the correct queue transport is used (JSON for old deployments, CBOR for new). Falls back to the run's specVersion if health check fails. Health check always uses JSON transport (specVersion: SPEC_VERSION_LEGACY) so the probe works against both old and new deployments. Also adds deploymentId option to HealthCheckOptions for targeted health checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 51fb2ab 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
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests▲ Vercel Production (1 failed)hono (1 failed):
🌍 Community Worlds (60 failed)mongodb-dev (1 failed):
redis-dev (1 failed):
turso-dev (1 failed):
turso (57 failed):
Details by Category❌ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
❌ Some E2E test jobs failed:
Check the workflow run for details. |
Both the HTTP (?__health) and queue-based health check endpoints now return the @workflow/core package version, allowing observability tools to identify exactly which SDK version a deployment is running. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VaguelySerious
added a commit
that referenced
this pull request
Apr 7, 2026
7 tasks
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
Based on #1627. CLI
startcommand now probes the target deployment's specVersion via health check before callingstart(), ensuring the correct queue transport is used.specVersion: SPEC_VERSION_LEGACY) so the probe works against both old and new deploymentsdeploymentIdoption toHealthCheckOptionsfor targeted health checksspecVersionif health check fails (e.g. old deployment without health check support)Other paths that call
start()without knowing specVersionstartrecreateRunFromExisting(web dashboard replay)run.specVersionfrom original runimport { start } from 'workflow')SPEC_VERSION_CURRENTis correctworld-testing)Test plan
packages/coreunit tests pass (580/580)startagainst old deployment uses JSON transportstartagainst new deployment uses CBOR transportstartwith health check timeout falls back to run specVersion🤖 Generated with Claude Code