fix(agents): webhook-miss sweep grace period (no double-fire)#280
Merged
fix(agents): webhook-miss sweep grace period (no double-fire)#280
Conversation
Mirrors adcontextprotocol/adcp's fix. Adds a 30-minute grace period to the webhook-miss sweep so it doesn't double-fire on issues where the original issues.opened webhook fired and the routine just hasn't applied the claude-triaging label yet. Two-bound filter on creation time: - Floor: 24 hours ago (existing — don't sweep ancient issues) - Ceiling: 30 minutes ago (NEW — give the original webhook + routine time to land at least the lifecycle label) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Adds a 30-minute grace period to the webhook-miss sweep so it doesn't double-fire on issues where the original
issues.openedwebhook fired and the routine just hasn't applied theclaude-triaginglabel yet.Observed bug
At 15:28:11Z (adcp), the sweep saw #3167 (created 15:26:48Z, 80s old) and #3166 (created 15:26:02Z, 2m old) as candidates and fired the routine on both. But the original triage runs were already in progress —
claude-triaginglanded on #3167 at 15:28:40Z and on #3166 at 15:28:50Z, 30+ seconds after the sweep had already re-fired. Two routine runs raced on each issue, wasting tokens and risking comment/label write races.Fix
Two-bound filter on creation time:
Max observed time from issue creation to
claude-triaginglabel was ~4m16s across the recent #3145/#3152/#3156/#3162/#3166/#3167 sample. 30 min is a generous safety margin while keeping recovery latency under ~90 min for a real webhook miss (sweep runs hourly at :17).🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com