fix(queue): unblock exact review publication#610
Merged
Conversation
Contributor
Author
|
@clawsweeper review |
Contributor
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
This was referenced Jul 15, 2026
This was referenced Jul 16, 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.
Summary
This fixes the confirmed path where a review completed successfully but its final ClawSweeper comment and labels could not be published. It deliberately does not bulk-rewrite every pending review row; the separate stale-pending recovery/capacity follow-up remains necessary if the producer backlog does not drain normally.
Incident evidence
At
2026-07-15T18:00:34Z, the live queue API reported:pending=1961,dispatching=1,leased=152026-07-15T11:01:02Zoldest_dispatching_at=2026-07-22T13:10:22Zwith age zeronext_wake_at=2026-07-15T20:05:52ZThe false future timestamp came from deriving the dispatch start by subtracting the normal six-minute lease from the seven-day publication lease introduced with #592. It made a multi-hour stuck handoff look healthy, but it was telemetry fallout rather than the cause.
The publication failure itself is directly visible in Actions:
Review event item openclaw/openclaw#107676@publish:29409874087:1, was created at13:16:24Zand was still pending at18:00Z11:07:50Zbut did not start until13:14:06Z12:22:22Zand did not start until16:10:32ZThe live GitHub concurrency endpoint initially showed 19 members in
clawsweeper-state-publisher, with the exact publisher last behind 18 generic publishers. At18:00Zit still showed three members in order: one running generic publisher, one pending generic publisher, then exact job87362614333. That proves the final publisher was queued behind bulk state work, not waiting for Codex or a runner after a claim. The current endpoint is here.Representative producer runs succeeded:
11:21:51Z, completed successfully11:35:41Z, completed successfullyThose runs reached real Codex completion, artifact upload, and durable publication enqueue. This rules out a global Codex/GPT, Cloudflare intake, token, or GitHub permission outage as the cause of the missing final comments/labels. It does not claim that every individual review run was healthy.
The issue timestamps are also not a reliable merge boundary: #107785 received its recorded labels at
10:41Z, and #107787 has a durable review comment at10:46Z, before the later producer runs above. The Actions concurrency evidence provides the actual causal boundary.Causal timeline
00:11:35Z: Vincent's #586 revert merged. It predates the publisher regression and is not on the causal path.10:38:45Z: Peter's #592 merged as30502fdf4e8acdcbf022302278af0e78a307eb65. It placed exactevent-review-publishand genericpublishjobs inclawsweeper-state-publisher, both serial withqueue: max, and extended unclaimed publication leases to seven days to tolerate that queue.10:55:39Z: #593 merged. It forwards exact-review bundle CLI commands; it does not separate or prioritize publishers.11:07:50Z: exact publisher job87336341784entered the shared group and waited over two hours.11:21Z/11:35Z: representative #107785/#107787 producer runs started and later succeeded.12:22:22Z: representative generic publisher job87350685065entered the same group and waited nearly four hours.13:16:24Z: run29418496158entered for an already-produced exact artifact and remained pending with no runner.13:17:47Z: #596 merged. Its Landlock fallback and exact-claim conflict handling are independently valid, but it does not change the shared publisher group.15:44:33Z: #601 merged as68f83c25fc564ebfb76ac75ed3d64a7cb1c07bb8. It stops dispatcher pauses from repeatedly deferring the whole pending backlog. It came after the publisher starvation and is not its cause.16:32:18Z: live queue sample:pending=1717,dispatching=1,leased=19, with the same future dispatch timestamp.18:00:34Z: live queue sample:pending=1961,dispatching=1,leased=15; exact run29418496158was still last in the shared publisher group.Why #601 is retained
#601 was evaluated specifically because it was not the publication root cause. Reverting it would restore a separate confirmed defect: a paused dispatcher rewriting retained pending rows'
nextAttemptAton every pass. The focused regressionexact-review queue defers retained backlog until a paused dispatcher retrypasses on this branch. This PR therefore keeps #601 and documents the distinction rather than combining a known regression into the incident repair.Other nearby work is also not causal:
Implementation
event-review-publishjobs useclawsweeper-exact-review-publisher; bulkpublishjobs remain inclawsweeper-state-publisher. Both lanes stay serial and non-cancelling.dispatchedAt. Reclamation, claim validation, queue wake scheduling, and stats all use the same effective expiry.409 lease_not_active.dispatchedAtand reports its actual age.Automatic recovery and backlog scope
After merge, the normal dashboard push workflow deploys the Worker because this PR changes
dashboard/**. Within one five-minute cron interval, an old unclaimed seven-day publication row is re-admitted and redispatched. New exact publisher jobs use the dedicated lane immediately. A late job from the old shared lane cannot publish twice because its lease tuple has been replaced.This should restore final comments and labels for completed reviews without a manual Actions dispatch or gate change. It will not immediately reprocess all
pending=1961producer rows. Those remain governed by normal exact-review capacity plus #601; bounded stale-pending recovery and the observed capacity under-utilization should be diagnosed separately before any bulk mutation.Validation
Windows focused proof on the final branch:
The queue regression recreates both live rollout paths: a persisted publication whose stored lease is seven days in the future but whose
dispatchedAtis 16 minutes old is recovered by the scheduled heartbeat; a second expired legacy dispatch is recovered when its stale job claims first. Both are redispatched with new tuples, and stale claims return 409.Hosted-Linux proof used Crabbox
local-container, imagemcr.microsoft.com/playwright:v1.60.0-noble, leasecbx_02442d834d3d:reconcile-recordsstate-race tests: 3 passedsweep.yml(archive SHA-2568aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8)Five unrelated full
sweep-workflowBash-fixture tests cannot run natively on this Windows host because its defaultdocker-desktopWSL distro has no/bin/bash; the touched workflow assertion and state-race proof passed in the Linux container. No platform policy or production shell surface was changed.Codex review closeout
codex review --uncommittedinitially found the valid rollout gap that old seven-day leases were not migrated; fixed and provedcodex review --uncommitted: clean, no actionable findingscodex review --base origin/main: clean, no actionable findings; confirmed the dedicated lane and recovery do not affect claimed executionsRisks and rollout
reconcile-recordswriter handles disjoint state races; all three continuous race tests passed on Linux..github/workflows/sweep.yml; OAuth tokens without workflow scope may not be able to update the branch. The maintainer branch push succeeded, and CI/actionlint still need to remain green.Links