feat: enforce max queue deliveries in handlers with graceful failure#1344
feat: enforce max queue deliveries in handlers with graceful failure#1344pranaygp wants to merge 1 commit intopgp/semantic-world-errorsfrom
Conversation
🦋 Changeset detectedLatest commit: d34edf9 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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests▲ Vercel Production (24 failed)astro (2 failed):
example (2 failed):
express (2 failed):
fastify (3 failed):
hono (2 failed):
nextjs-turbopack (2 failed):
nextjs-webpack (2 failed):
nitro (2 failed):
nuxt (3 failed):
sveltekit (2 failed):
vite (2 failed):
🌍 Community Worlds (56 failed)mongodb (3 failed):
redis (2 failed):
turso (51 failed):
📋 Other (1 failed)e2e-local-postgres-nest-stable (1 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. |
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3ff6de8 to
9929b57
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9929b57 to
d34edf9
Compare
2841381 to
90bd273
Compare

Summary
Removes the VQS
maxDeliveries: 64cap and instead has workflow/step handlers enforce their own max delivery limit with graceful failure. This prevents "phantom stuck" runs where VQS drops the message after 64 retries and the run silently stalls inrunningstatus.Stacked on #1342 → #1340 → #1339
Problem
When infrastructure is down (OOMs, network outages, etc.), VQS retries messages at 5s intervals up to
maxDeliveries: 64times. After exhausting retries, VQS drops the message. The run stays inrunningstatus forever with no error, no failure event, no recourse — a "phantom stuck" run.Solution
maxDeliveriesfrom VQS config — allow infinite retries at the queue levelretryAfterSeconds: 5— VQS-level retry timing (works even after SIGKILL/OOM)metadata.attempt— when delivery count exceedsMAX_QUEUE_DELIVERIES(64), the handler fails the run/step gracefully withMAX_DELIVERIES_EXCEEDEDerror codeWorkflow handler behavior at max deliveries:
run_failedevent witherrorCode: 'MAX_DELIVERIES_EXCEEDED'EntityConflictErrororRunExpiredError→ run already terminal, skipStep handler behavior at max deliveries:
step_failedeventLocal world queue:
Test plan
failedwithMAX_DELIVERIES_EXCEEDED🤖 Generated with Claude Code