Skip to content

feat(webhook): detect event type from payload.action field - #59676

Closed
TimCrooker wants to merge 1 commit into
NousResearch:mainfrom
TimCrooker:feat/webhook-action-event-type
Closed

feat(webhook): detect event type from payload.action field#59676
TimCrooker wants to merge 1 commit into
NousResearch:mainfrom
TimCrooker:feat/webhook-action-event-type

Conversation

@TimCrooker

Copy link
Copy Markdown

Summary

The webhook event type detection chain currently checks X-GitHub-Event, X-GitLab-Event, payload.event_type, and payload.type — but does not check payload.action, the field used by Sentry, PagerDuty, and many other services to discriminate events.

Change

Adds payload.get("action", "") to the fallback chain so services that use action as the event discriminator are correctly routed.

Testing

Tested with live Sentry webhook events through a Hermes gateway instance. Before this change, Sentry error.created events were classified as unknown and ignored by event-type filters. After this change, they are correctly identified as error.created and routed to the appropriate agent run.

Compatibility

  • Backward compatible: the action field is checked after all existing fields, so GitHub (X-GitHub-Event), GitLab (X-GitLab-Event), and services using event_type/type are unaffected.
  • No schema changes, no new dependencies.

The webhook event type detection chain currently checks headers
(X-GitHub-Event, X-GitLab-Event) and payload fields (event_type,
type), but does not check payload.action — the field used by Sentry,
PagerDuty, and many other services to discriminate events.

This adds payload.get("action", "") to the fallback chain so that
webhooks from services that use 'action' as the event discriminator
are correctly routed through event-type filters rather than falling
through to 'unknown'.
Copilot AI review requested due to automatic review settings July 6, 2026 14:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery platform/webhook Webhook / API server sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages P3 Low — cosmetic, nice to have labels Jul 6, 2026
@teknium1

teknium1 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for this PR — webhook payload filtering has now landed on main via #60944 (salvage of @evelynburger's #57544), which generalizes this: route-level payload filters (equals/not_equals/contains/exists/... on payload fields, event type, and headers) plus optional route scripts for transform/narrow logic, wired through hermes webhook subscribe --filter/--script and config.yaml. Your use case should be covered by the generic filter syntax; if something specific is missing, please open a fresh issue against the new mechanism. Closing as superseded — appreciate the earlier push in this direction.

@teknium1 teknium1 closed this Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/webhook Webhook / API server sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants