fix(world): namespace startup re-enqueue queue names#2885
Closed
asdiamond wants to merge 1 commit into
Closed
Conversation
reenqueueActiveRuns hardcoded the un-namespaced __wkf_workflow_ prefix, so on worlds running under a queue namespace (WORKFLOW_QUEUE_NAMESPACE, e.g. eve agents) every recovered run was re-enqueued onto a queue name the handler rejects with "Unhandled queue", producing an endless retry loop after every restart. Build the queue name with getQueueTopicPrefix + resolveQueueNamespace so recovery targets the same queues as live enqueues, and accept an optional explicit namespace argument for worlds configured without the env var. Surfaced downstream in vercel/eve#715. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Aleksandr Diamond <diamondaleksandr@gmail.com>
🦋 Changeset detectedLatest commit: 42745f3 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
|
@asdiamond is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
Thanks for making the PR! We separately found and addressed this in #2888. A release with the fix will go out soon |
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.
Problem
reenqueueActiveRuns(startup recovery in@workflow/world, used byworld-localandworld-postgres) hardcodes the un-namespaced queue prefix:When the runtime operates under a queue namespace (
WORKFLOW_QUEUE_NAMESPACE), the workflow handler is registered with the namespaced prefix__{namespace}_wkf_workflow_and rejects anything else with HTTP 400Unhandled queue. Live enqueues honor the namespace, so normal operation works — but every run recovered at startup is enqueued onto a name that can never match, and since rejected deliveries are retried without a cap, each recovered run becomes a permanent ~5s retry loop after every restart.This is very visible downstream in eve, which installs an agent-scoped namespace on boot: any parked session produces endless log spam on every dev-server restart. Reported there as vercel/eve#715 (root-cause analysis in this comment):
Fix
Build the recovery queue name with the same namespace-aware helpers live enqueues use (
getQueueTopicPrefix+resolveQueueNamespace), and accept an optional explicitnamespaceargument for worlds configured without the env var. Behavior without a namespace is unchanged (__wkf_workflow_…).Testing
recovery.test.tscovers the default (un-namespaced), env-var, and explicit-argument cases.@workflow/worldsuite passes (74 tests) andtscbuilds clean.Unhandled queueindefinitely; session continuation itself was unaffected (it goes through the namespaced live path), confirming the mismatch is isolated to recovery.