Repository navigation
Done
Description
A plugin webhook route did its writes inside the request. When one write failed, the work was either lost or retried only by a path that the plugin built itself. Junior had no general way for a plugin route to hand failed work to a durable retry with backoff. Raised by @BYK in review of #4102.
Retry paths before
- Webhook redelivery: a thrown error makes the route fail. GitHub does not send a failed delivery again by itself. A person must redeliver it by hand.
- Daily reconcile: the GitHub plugin heartbeat claims one repository a day and reads its stale open pull requests again. Work that has no stored open row, such as a lost issue close or a failed chip write, has no retry.
- Plugin tasks already ran on Vercel Queues, but core started them only after a Turn completed. A route could not start one.
What shipped (#4109)
Vercel Queues through plugin tasks, with no table and no heartbeat recovery.
- A plugin declares a started task with a
payloadschema in itstasks. A route or a heartbeat starts it withctx.tasks.start({ name, key, payload }). - Core parses the payload with the task's schema, then sends it in a signed message on the plugin task topic. Core stores nothing in Postgres.
- The queue idempotency key is a hash of the plugin and its key, because Vercel Queues accepts at most 256 characters. A second start with the same key does nothing while the queue keeps the message, which is 1 h.
- Each attempt parses the payload again and runs the handler. A failed attempt throws, and the queue runs it again with a fixed backoff of 30, 60, 120, then 240 s. After the 5th delivery, core logs
plugin.task.failedand acknowledges the message. - A handler must be safe to run again after a partial run.
Answers to the open questions
- Retry delay: one fixed backoff in core for every task.
- Terminal failure: logs only, as
plugin.task.failed.
Not built
- The durable task table, row claims, leases, and the heartbeat recovery of lost deliveries.
Follow-up
- The GitHub plugin's pull request cache patch moves from its heartbeat list to a delayed started task.
via @BYK.
--
Metadata
Metadata
Assignees
Labels
No labels
Activity
sentry-junior commentedon Nov 23, 2026
PR: #4109