ci(dispatch): cap agent overload retry at 2 attempts#40
Merged
Conversation
The agent retry recovered transient 429s from the model service but would spend up to 4 attempts (0+30+60+120s backoff) doing so. Each attempt burns real GLM budget, and a 429 that does not clear in two tries likely indicates a sustained outage rather than a blip, so further retries just waste tokens. Cap at 2 attempts with a single 60s backoff. The safety properties are unchanged: only an explicit 429/overload marker is retried; exit 0/3/4 and any non-429 error remain final on the first attempt. Verified by simulating five cases: first-attempt success (1 attempt); 429-then-success recovers (2 attempts); persistent 429 caps at 2; non-429 error does not retry (1 attempt); 429-then-non-429 stops at 2. build/vet green; no em dashes per AGENTS.md.
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.
Closes #none (CI tuning, no issue).
Problem
The agent retry (added to recover transient 429s from the model service) would spend up to 4 attempts with escalating backoff (0+30+60+120s). Each attempt burns real GLM budget, and a 429 that does not clear in two tries likely indicates a sustained outage rather than a blip, so further retries just waste tokens. Run 28072226718 hit a 429 and the prior 4-attempt retry would have held the job for ~3.5 min of backoff before giving up.
Changes
.github/workflows/dispatch.yml: theRun dispatch agentretry is capped at 2 attempts with a single 60s backoff. Safety properties unchanged: only an explicit 429/overload/rate-limit marker is retried; exit 0/3/4 and any non-429 error remain final on the first attempt (a deterministic bug never wastes a second attempt).How to test
Simulated five cases: (1) first-attempt success = 1 attempt; (2) 429 then success = recovers in 2; (3) persistent 429 = caps at 2; (4) non-429 error = 1 attempt, no retry; (5) 429 then non-429 = stops at 2. The budget-safety property (never retry a non-429 error) holds in every case.
Verification
go build ./... && go vet ./...pass (no Go touched). YAML valid, 12 steps. Retry control flow simulated across 5 cases. No em dashes per AGENTS.md.