Skip to content

fix(webhook): skip self-triggered events at the dispatch gate - #120

Merged
MathurAditya724 merged 1 commit into
mainfrom
fix/webhook-skip-self-triggered
Aug 5, 2026
Merged

fix(webhook): skip self-triggered events at the dispatch gate#120
MathurAditya724 merged 1 commit into
mainfrom
fix/webhook-skip-self-triggered

Conversation

@MathurAditya724

Copy link
Copy Markdown
Member

Summary

The webhook gate dispatches any event on a jared-labeled PR/issue — including events whose sender is the bot itself. When jared submits a PR review, GitHub fires pull_request_review.submitted with sender = jared-outpost[bot]; since the PR carries the jared label, the gate marked it dispatched, woke a container, and booted Flue just for the in-container router to discard it via skip condition #1 (sender == $ME).

Observed on getsentry/cli#1363: the agent reviewed the PR, posted a comment review, and its own review submission re-dispatched a fresh container that only skipped.

This mirrors that skip at the Worker gate: drop events where sender === botLogin, except check_suite / workflow_run (CI on the bot's own commits is genuinely actionable and feeds fix-ci / mark-pr-ready) — matching the exception already in jared.md.

Changes

  • apps/server/src/routes/webhooks/github.ts: compute isSelfTriggered and fold it into isSkipped.

Test plan

  • vitest run (server) — 51/51 pass
  • biome check clean on the edited file
  • tsc — no new errors (3 pre-existing errors in unrelated files, present on main)
  • Post-merge: re-label a PR and confirm jared's own review submission no longer shows a second dispatched event

Made with Cursor

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 <cursoragent@cursor.com>
@MathurAditya724
MathurAditya724 enabled auto-merge (squash) August 5, 2026 14:54
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
jared b400dc3 Aug 05 2026, 02:54 PM

@MathurAditya724
MathurAditya724 merged commit eb50fd6 into main Aug 5, 2026
16 of 18 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/webhook-skip-self-triggered branch August 5, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant