fix(triggers): surface handler self-skip reason in webhook decisionReason#1235
Merged
zbigniewsobiecki merged 3 commits intodevfrom Apr 29, 2026
Merged
fix(triggers): surface handler self-skip reason in webhook decisionReason#1235zbigniewsobiecki merged 3 commits intodevfrom
zbigniewsobiecki merged 3 commits intodevfrom
Conversation
Merge dev → main: Fix 1 (BullMQ coalesce unique jobIds) + Fix 2 (snapshot rmi on PR merge)
Merge dev → main: backlog-manager scope safety (#1233)
…ason PR zbigniewsobiecki/ucho#155 had a CI failure that should have triggered respond-to-ci. The webhook arrived; cascade-router logged "No trigger matched for event" and bailed. The trigger DID match — something inside the handler self-skipped, but the persisted webhook log flattened the reason into the same generic string used when no matcher matches at all. Debugging that required trawling cascade-router process logs. Three coordinated fixes: A) Diagnostic upgrade. Extend TriggerResult with `skipReason: { handler, message }`. Handlers can return a structured skip instead of bare null; the registry returns the structured skip up the stack (terminating dispatch, not iterating further). webhook-processor.ts surfaces `Trigger ${handler} skipped: ${message}` in decisionReason. Bare `return null` keeps the legacy "try-next-handler" semantic for backward compatibility. Converted every return-null site in check-suite-failure.ts and pr-conflict-detected.ts to structured skips with specific messages (PR # included, attempt counts spelled out, base branches named). B) Stop swallowing persona-resolution failures in `GitHubAdapter.resolvePersonaCached`. The bare `catch {}` made every downstream gate that depends on personaIdentities silently skip without any signal. Now logs ERROR + Sentry-captures under tag `persona_identity_resolution_failed`. C) Widen the "PR author must be implementer persona" gate in both check-suite-failure.ts and pr-conflict-detected.ts to use the existing `isCascadeBot()` helper, matching either the implementer OR reviewer persona. The narrow check would have silently dropped any future PR authored by the reviewer persona; pr-comment-mention.ts and review-requested.ts already had the broader semantic. For PR #155 specifically: aaight IS the implementer for ucho, so the gate-widening (C) doesn't change the outcome — but with (A) shipped, any re-run will report the actual reason in the dashboard webhook log. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
zbigniewsobiecki
added a commit
that referenced
this pull request
Apr 29, 2026
Merge dev → main: respond-to-ci diagnostics + persona-scope hardening (#1235)
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the diagnostic gap that hid why zbigniewsobiecki/ucho#155's CI failure didn't trigger `respond-to-ci`. Webhook log decisionReason was `'No trigger matched for event'` — the same string used when no matcher matched at all, even though one DID match and self-skipped inside its handler.
Three coordinated fixes
Fix A — Plumb structured `skipReason` through TriggerResult → registry → webhook-processor
`TriggerResult` gains an optional `skipReason: { handler: string; message: string }`. Handlers return a structured skip instead of bare null; the registry returns the structured skip up the stack (terminating dispatch). `webhook-processor.ts` surfaces `Trigger ${handler} skipped: ${message}` in decisionReason. Bare `return null` keeps the legacy "try-next-handler" semantic for backward compat.
Every `return null` site in `check-suite-failure.ts` and `pr-conflict-detected.ts` converted to structured skips with specific messages (PR # included, attempt counts spelled out, base branches named).
Fix B — Stop swallowing persona-resolution failures
`GitHubAdapter.resolvePersonaCached` had a bare `catch {}` that hid every persona-token failure. Now logs ERROR + Sentry-captures under tag `persona_identity_resolution_failed`. One of the prime suspects for what hit PR #155.
Fix C — Widen "PR author must be implementer" gate to "any cascade persona"
`check-suite-failure.ts` and `pr-conflict-detected.ts` previously compared only against `personaIdentities.implementer`. Now use the existing `isCascadeBot()` helper, matching either persona. `pr-comment-mention.ts` and `review-requested.ts` already had the broader semantic.
For PR #155 specifically: aaight IS the implementer for ucho, so Fix C doesn't change the outcome — but with Fix A shipped, any re-run will report the actual blocker in the dashboard webhook log.
Test plan
🤖 Generated with Claude Code