Skip to content

fix(agents): webhook-miss sweep grace period (no double-fire) - #3178

Merged
bokelley merged 1 commit into
mainfrom
bokelley/sweep-grace-period
Apr 25, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/sweep-grace-period

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

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.

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-triaging landed 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:

  • Floor: 24 hours ago (existing — don't sweep ancient issues)
  • Ceiling: 30 minutes ago (NEW — give the original webhook + routine time to at least land the lifecycle label)

Max observed time from issue creation to claude-triaging label 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) [email protected]

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.

Observed bug: at 15:28:11Z the sweep saw #3167 (created 15:26:48Z,
80s old) and #3166 (created 15:26:02Z, 2m old) as candidates, fired
the routine on both, but the original triage runs were already
in progress — claude-triaging landed on #3167 at 15:28:40Z and on
#3166 at 15:28:50Z, after the sweep had re-fired. Two routine runs
raced on each issue.

Fix: 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)

Max observed time from issue creation to claude-triaging label is
~4m16s. 30 min is generous safety margin while keeping recovery
latency under ~90 min for a real webhook miss.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley
bokelley merged commit 8bd30db into main Apr 25, 2026
12 checks passed
@bokelley
bokelley deleted the bokelley/sweep-grace-period branch April 25, 2026 16:04
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