fix: preserve exact review leases and requeue legacy artifacts#612
Merged
Conversation
This was referenced Jul 15, 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
Repairs the exact-review publication path that stopped applying durable ClawSweeper comments and labels after the read-only review/publisher split.
Incident evidence and causal chain
#592split exact review generation from publication and made the Codex producer read-only with--skip-start-comment. That left reports without the durable lease tuple which the separated publisher needs to prove it owns the visible review lifecycle.The current publisher then safely refused to overwrite a live lease, reporting:
It recorded
skipped_stale_review_comment_sync,publish-event-resultfailed, and the durable publisher queue retried without producing the expected comments/labels. This is demonstrated in these failed publisher runs:openclaw/openclaw#107559)openclaw/openclaw#107676)openclaw/openclaw#101776)The live backlog audit recorded 2,310 pending exact reviews with only 12 of 64 active at the sampled point. It does not claim every pending item has this same source action.
#610and#611address separate queue/per-target publishing concerns; they do not restore the missing report lease tuple.Related: #592, #610, #611.
Safety and rollout
Codex remains read-only against the target. The short lease-reservation step and the publisher alone receive target-write credentials. A legacy artifact with no tuple is not applied; it is requeued as a fresh exact review. A changed source revision, including one that changes while the apply mutation lease is held, is likewise recorded as
skipped_changed_since_reviewand requeued. This PR does not bulk re-admit all pending rows; that remains a separate guarded recovery task.Validation
Ran locally:
The focused workflow tests and YAML parse passed after the final 45-minute cap.
actionlintis not installed on this host. The aggregate workflow test has unrelated native-Windows baseline failures because WSL's/bin/bashis unavailable; the focused workflow tests above pass.Codex review surfaced and this patch fixes: legacy/source-drift requeue handling, issue-vs-PR lease comparison, the exact-review timeout/lease verifier bound, job-headroom accounting, and the queue execution-lease bound. Per maintainer instruction, the final review loop was stopped after the last correction, so the post-correction branch review is intentionally not claimed as clean.