Repository navigation
fleet-queue: retire already-done tasks at claim, before any session (#10626) - #11799
Merged
Merged
Conversation
…10626) The default claim pick now checks a picked row's linked work. When its linked PR already merged, or (with no PR) its issue already closed, the row is retired in place as done with outcome already_done, the evidence on its result and a staleness_autocomplete event, before any lease, session binding or claimed event; the pick moves on to the next row. Tier 1 is work that landed before the task was created, tier 2 work that landed before this claim; the evidence names the tier, and FLEET_STALENESS_TIER2=0 turns tier 2 off. The check fails open: no probe, no linkage, a lookup error or a lookup slower than 1.5s claims as before, and a failure stands the check down for a minute. Landed facts are cached for the broker's life, open states for ten minutes. FLEET_STALENESS_CHECK=0 turns it off and a packet can opt out with staleness_check: false. By-id, transfer and handoff claims are untouched, so the #9178 override path stays. Refs #10626 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dezren39
marked this pull request as ready for review
November 18, 2026 12:10
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 18, 2026
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.
Before: a queued task whose linked issue had already closed, or whose linked PR had already merged, was still handed to a lane. A session spawned, found nothing to do and closed it. The 2026-11-16 measurement put this at 27.8% of non-triage completions, with 72 tasks burning 30 minutes or more.
After: the broker's default claim pick checks the picked row's linked work first. If it already landed, the row is retired as done with outcome
already_done, its evidence on the result and astaleness_autocompleteevent, and the pick moves on. No lease, session binding orclaimedevent is written for it.How: a new
turso_queue/staleness.rsresolves links frompayload.pr/payload.prs[]/result.pr/pr_url, elsepayload.issue, under the task's repo. A linked PR decides on its own (a shepherd task for an open PR stays live even if its issue closed). The broker's GitHub probe gainsprobe_landing(issueclosed_at, PRmerged_at) with a 1.5s per-request timeout; other probes default to Unknown, which never retires anything.FLEET_STALENESS_TIER2=0turns tier 2 off.FLEET_STALENESS_CHECK=0turns it off; a packet can setstaleness_check: false.Tests:
cargo test -p fleet-queue --all-features --lib(436 pass), including tier 1/2, fail-open, PR-over-issue, opt-out, cache, stand-down and a source-order check that the retire happens before lease, binding and the claimed event.Refs #10626
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.