Repository navigation
fix: jitter outage-issue dedup to handle concurrent matrix-leg failures - #586
Merged
Merged
Conversation
Adds `sleep $((RANDOM % 30))` before the `gh issue list` check in the `Report failure` step of both action.yaml and codex/action.yaml. The randomized backoff staggers concurrent matrix-leg failures so legs that fail within seconds of each other (e.g. Anthropic 529s exhausting the retry budget across every leg) don't all read $EXISTING as empty in parallel and file duplicate `tend-outage` issues. Refs #580. Co-Authored-By: Claude Opus 4.7 <[email protected]>
max-sixty
added a commit
that referenced
this pull request
May 23, 2026
## Summary - Bumps generator version to 0.1.0 and syncs lockfile. 7 commits since 0.0.25: - fix: jitter outage-issue dedup to handle concurrent matrix-leg failures (#586) - fix: install-test default-branch probe on shallow checkout (#583) - fix: pin install-tend badge link to max-sixty/tend (#585) - skills(review-reviewers): call out commenter-self-edit filters as a non-issue (#581) - triage: skip on tend-outage labeled issues (#579) - fix: use REST API for author_association in triage skill (#571) - skills(running-in-ci): catch already-merged sibling PRs in dedup (#569) ## Test plan - [x] `wt test` passes - [x] `pre-commit run --all-files` passes - [ ] CI green
This was referenced Jun 29, 2026
max-sixty
pushed a commit
that referenced
this pull request
Jul 10, 2026
…leg failures (#744) ## Problem The outage-tracker dedup in `shared/steps/report-failure.sh` is racy, and the jitter added in #586 to fix it has now been proven insufficient in production. When several matrix legs fail within a few seconds of each other (the common case for an upstream model-API 5xx/overload incident, which hits every leg at once), each leg runs the check-then-create dedup. The `sleep $((RANDOM % 30))` jitter only *narrows* the create-create window — it can't close it. Two legs can still both read `EXISTING` as empty: jitter collisions are likely with several legs drawing from a 30-slot range (birthday problem), and GitHub's issue-list index takes a few seconds to reflect a freshly-created issue, so even a staggered second leg can miss the first's issue. ## Evidence - **2026-05-22**: four duplicate `tend-outage` issues (#575, #576, #577, #578) created within 4 seconds. This prompted #586 (jitter). - **2026-06-29**: the jitter mitigation failed — an all-five-legs `review-reviewers` failure ([run 28352782724](https://github.com/max-sixty/tend/actions/runs/28352782724), transient `529 Overloaded`/StopFailure) produced **two** duplicate trackers #742 and #743, created within 1 second (06:23:30 and 06:23:31), both referencing the same run. Every prior incident with only 1–2 failing legs produced a single tracker, so the failure mode scales with the number of simultaneously-failing legs. Impact is low (both dupes were auto-closed by nightly ~2h later when the outage resolved), but it's a recurring structural failure of a deployed fix, and it generates duplicate "Bot temporarily unavailable" notifications during every wide outage. ## Fix Keep the jitter (it still reduces contention and the number of dupes created) and add a self-healing reconciliation to the create path: after `gh issue create`, settle briefly for the list index, then list every open `tend-outage` issue, keep the lowest-numbered, and close the rest as duplicates. It is idempotent and convergent — every racing leg computes the same keeper, so a second leg closing an already-closed dup is a no-op. This is shared verbatim by all three harness actions, so it reaches every consumer at the next release. <details><summary>Verification</summary> - `shellcheck shared/steps/report-failure.sh` passes. - Logic unit-tested against today's numbers: `[{742},{743}]` → keep #742, close #743; single-issue input closes nothing. - Index-lag safety: the 5s settle plus the convergent keep-lowest rule means even if leg B's first re-list misses leg A's issue, both legs eventually compute the same keeper and the loser is closed. </details> Found by `review-runs` analyzing [run 28361647677](https://github.com/max-sixty/tend/actions/runs/28361647677). Co-authored-by: tend-agent <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
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.
Implements option (1) from #580 — a jittered backoff before the dedup check in the
Report failurestep.When a matrix workflow's legs fail at near-identical times (e.g. an Anthropic 529 burst exhausting the retry budget across every leg within ~5 seconds), all legs read
$EXISTINGas empty in parallel and each file their owntend-outageissue. Addingsleep $((RANDOM % 30))beforegh issue liststaggers the legs so later ones see the first leg's issue.This is the cheap practical fix called out in the issue — it doesn't eliminate the race in pathological cases, but it covers the observed real-world failure mode. Applied to both
action.yaml(Claude harness) andcodex/action.yaml(Codex harness).Closes #580.