workflow: re-land vercel-queue port, with the naming fixes it needed - #184
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
fantix
force-pushed
the
fantix/workflow-with-vercel-queue
branch
from
July 28, 2026 19:43
f31846c to
962bb68
Compare
fantix
force-pushed
the
fantix/workflow-with-vercel-queue
branch
from
July 28, 2026 20:44
962bb68 to
c3c5b00
Compare
fantix
marked this pull request as ready for review
July 28, 2026 20:59
Switch Workflow SDK from vercel-workers to vercel-queue (cherry picked from commit 92d7b95)
The port to vercel-queue routed workflow topics through `vqs.sanitize_name()`, whose reversible encoding doubles underscores, so `__wkf_workflow_` went out as `____wkf__workflow__` — outside the `__wkf_*` prefix that the builder's trigger pattern and platform service resolution key on, and out of step with what `@workflow/world-vercel` publishes. It also left `consumer_group` unset on `VercelWorld`, so subscribers registered under a name derived from the handler's qualname, which moves whenever that function is renamed. Dispatch is keyed on `(consumer_group, topic)`, so both matter. Both worlds now share `get_physical_topic()` and `QUEUE_CONSUMER_GROUP` in `world.py`. The Vercel push callback hands the delivery to the world's own queue client, so acks and lease renewals inherit the proxy URL and token instead of falling back to an unconfigured default.
fantix
force-pushed
the
fantix/workflow-with-vercel-queue
branch
from
July 31, 2026 21:00
c3c5b00 to
669b7c4
Compare
msullivan
approved these changes
Jul 31, 2026
Merged
msullivan
added a commit
that referenced
this pull request
Jul 31, 2026
vercel-internal-core -------------------- 0.1.1 - 2026-07-31 ------------------ Bug Fixes --------- - Bind asynchronous session clients to their running event loop to prevent failures when a shared session is used across multiple event loops or threads. (#220) vercel-queue ------------ 0.7.2 - 2026-07-31 ------------------ Bug Fixes --------- - Don't require `VERCEL_DEPLOYMENT_ID` to be set when running against a `vercel dev` queue broker. (#211) - This will allow us to revert `vc dev` setting `VERCEL_DEPLOYMENT_ID`. (#211) vercel-sandbox -------------- 0.3.0 - 2026-07-31 ------------------ Features -------- - Add `get_or_create_sandbox` to retrieve a named sandbox or create it when it does not exist, for both async and synchronous APIs. (#220) vercel ------ 0.8.0 - 2026-07-31 ------------------ Breaking Changes ---------------- - `vercel.sandbox` is now the promoted Sandbox API that previously lived at `vercel.unstable.sandbox`. The former `vercel.sandbox` surface, including `AsyncSandbox`, `Command`, `AsyncCommand`, and `TokenProvider`, is gone, and `vercel.unstable` has been removed. Use `vercel.sandbox` for the async API and `vercel.sandbox.sync` for the synchronous API. (#195) - The Sandbox implementation now ships in the separate `vercel-sandbox` distribution, which `vercel` depends on, so `vercel.sandbox` imports keep working without installing anything extra. (#195) - Workflow and step identifiers now use `//` between the module and qualified name to match the TypeScript SDK format. (#220) Features -------- - Add `vercel.functions.wait_until()` for post-response asynchronous work that remains attached to the current Python Function invocation. (#218) - Port from vercel-workers to vercel-queue (#184) Internal -------- - Move Vercel SDK tests under the package-local test suite. (#194) vercel-celery ------------- 0.7.2 - 2026-07-31 ------------------ - Update dependencies. vercel-dramatiq --------------- 0.7.1 - 2026-07-31 ------------------ - Update dependencies.
fantix
added a commit
that referenced
this pull request
Aug 14, 2026
`HTTPRequest` asked for `httpx.Headers`, which the vercel-queue port introduced (#184) because the request object is handed straight to `accept_and_handle` -- it satisfied that protocol and was the type at hand. It is about to be public, and it should not make implementing an adapter mean constructing httpx objects: vercel-queue's own push API takes `Mapping[str, str]` and wraps it at the boundary. So the contract is a plain mapping, and the wrapping moves to the one place that reads headers. That is not cosmetic: a plain mapping is case-sensitive, and only ASGI guarantees lowercase -- WSGI and http.server do not -- so a delivery from either used to be answered "Missing required headers". `HTTPRequest` is also a Protocol now, so an adapter may supply the four members on an object it already has instead of inheriting ours.
fantix
added a commit
that referenced
this pull request
Aug 15, 2026
`HTTPRequest` asked for `httpx.Headers`, which the vercel-queue port introduced (#184) because the request object is handed straight to `accept_and_handle` -- it satisfied that protocol and was the type at hand. It is about to be public, and it should not make implementing an adapter mean constructing httpx objects: vercel-queue's own push API takes `Mapping[str, str]` and wraps it at the boundary. So the contract is a plain mapping, and the wrapping moves to the one place that reads headers. That is not cosmetic: a plain mapping is case-sensitive, and only ASGI guarantees lowercase -- WSGI and http.server do not -- so a delivery from either used to be answered "Missing required headers". `HTTPRequest` is also a Protocol now, so an adapter may supply the four members on an object it already has instead of inheriting ours.
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.
Re-lands #185 (reverted in #189), plus the naming fixes it needs. Local-restart recovery, originally on this branch, moves to a follow-up PR.
Do not release before vercel/vercel#17236 is deployed, and ship this as
vercel0.8.0 — that PR gates onMIN_QUEUE_WORKFLOW_SDK_VERSION = '0.8.0'. Until it lands, the builder serves workflows through the legacy vercel-workers trampoline, which #185 removed. (The release flow already lands on 0.8.0.)The fixes
With #17236 the builder introspects
get_subscriptions()and copies our topic and consumer group into the trigger, so both have to be right:sanitize_name()'s reversible encoding doubles underscores, putting__wkf_workflow_outside the__wkf_*prefix the trigger pattern and platform-side service resolution key on.get_physical_topic()now does what@workflow/world-verceldoes: replace non-[A-Za-z0-9-_]with-, nothing else.VercelWorldpassed none and fell back to the handler's qualname, which moves silently on rename. Now an explicitQUEUE_CONSUMER_GROUP=default, matching whatcreateWorkflowQueueTriggerwrites for TypeScript.Both live in
world.pyand are shared by both worlds, so they can't drift.Also: push callbacks use the world's own queue client, so acks and lease renewals inherit the proxy URL and token instead of a default
QueueClient().Testing
Contract tests for the topic mapping and consumer group in
test_workflow_queue_namespace.py, with the reasoning in comments so nobody reaches forsanitize_name()again;test_workflow_step_retry_dispatch.pyupdated to the real topics. Its
isolated_subscriptionsfixture moved totests/unit/conftest.py—create_queue_handlerregisters a subscriber as a side effect that otherwise leaks into later tests.