fix(scheduler): idle fill leaves a supersession backoff alone — the owning PR does not close because a slot is free (AGT-4036) - #653
Merged
Conversation
…wning PR does not close because a slot is free (AGT-4036) A run refused because an open PR still owns its planned files is parked in RETRY_AT with an exponential backoff (retryAtFor). Idle fill lifted that row every heartbeat, so the drafter re-ran against the same PR 25 s apart: AX-1481 reached attempt #415 on 2026-09-17, 256 'Task superseded' lines in one log file, $0.37 of draft/decompose calls for a task that could not start. The backoff is the recheck cadence.
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.
Why
AGT-4036 asked for a deferred claim to stop wearing
superseded; that landed in #493 (deferredstatus). Its DoD —grep 'Task superseded'returns only genuine supersessions — is still violated, from a different direction: the current daemon log has 256Task supersededlines, 84 of them AX-1481, and the ledger shows AX-1481 at attempt #415, ~25 s apart:The supersession is genuine and the exponential backoff (
retryAtFor, 5 min × 2ⁿ up to 6 h) is set correctly — thenfilterAlreadyProcessed's durable idle-fill branch (idleLiftable) lifts any futureRETRY_ATwhile a slot is free. A free slot does not close the PR that owns the files, so each lift re-runs the drafter against the same PR: 8 draft + 17 decompose calls, $0.37, for one task that could not start.What
idleLiftableexcludeslastErrorCode === 'superseded'— the same shape as the AGT-4305 infra_error gate, one condition. Everything else (ordinary rejection backoffs, NEEDS_SPEC/NEEDS_ENV, elapsed RETRY_AT) is lifted as before.Verified
autonomousRunner.infraError.test.ts: new case seeds a durableRETRY_ATwitherrorCode: 'superseded'→ not lifted, staysRETRY_AT; control case witherrorCode: 'rejected'→ lifted toREADY. Mutant (drop the condition) fails the first. 15 passed (one 30 s hook timeout in an unrelated case at load 90, green on rerun).After deploy
grep -c 'Task superseded' stdout.logper hour should fall from ~40 to the number of genuinely blocked issues × their backoff rechecks.