From b400dc3afdf2ff585538b7521014a7b08a398edf Mon Sep 17 00:00:00 2001 From: mathuraditya724 Date: Wed, 5 Aug 2026 20:23:14 +0530 Subject: [PATCH] fix(webhook): skip self-triggered events at the dispatch gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The webhook gate dispatched events whose sender is the bot itself (e.g. jared's own PR review submission on a jared-labeled PR). That woke a container and booted Flue only for the in-container router to discard it via skip condition #1 (sender == $ME) — a wasted dispatch per self action. Mirror that skip at the Worker gate: drop events where sender == botLogin, except check_suite / workflow_run (CI on the bot's own commits is actionable and feeds fix-ci / mark-pr-ready), matching the router exception. Co-authored-by: Cursor --- apps/server/src/routes/webhooks/github.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/server/src/routes/webhooks/github.ts b/apps/server/src/routes/webhooks/github.ts index 80350da..4b19304 100644 --- a/apps/server/src/routes/webhooks/github.ts +++ b/apps/server/src/routes/webhooks/github.ts @@ -117,7 +117,14 @@ const router = new Hono().post("/", async (c) => { hasLabel = Array.isArray(labels) && labels.some((l) => l.name === TRIGGER_LABEL) } } - const isSkipped = !(hasLabel || isBotEntity) + // Self-triggered events (the bot reacting to its own comments/reviews/pushes) + // are never actionable — the in-container router (jared.md skip condition #1) + // already discards them. Skip here too so we don't wake a container just to + // have it skip. Exception: CI events on the bot's own commits ARE actionable + // (fix-ci / mark-pr-ready), matching that same router exception. + const isSelfTriggered = !!botLogin && sender === botLogin && event !== "check_suite" && event !== "workflow_run" + + const isSkipped = isSelfTriggered || !(hasLabel || isBotEntity) const containerKey = entityKey?.key ?? `ephemeral/${deliveryId}` const eventId = crypto.randomUUID()