fix: skip stale label sync for newer review comments#417
Merged
steipete merged 3 commits intoJul 5, 2026
Conversation
Contributor
Author
|
@clawsweeper re-review |
Contributor
|
🦞🧹 I asked ClawSweeper to review this item again. |
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (9 earlier review cycles; latest 8 shown)
|
Contributor
Author
|
@clawsweeper re-review |
Contributor
Author
|
@clawsweeper re-review |
1 similar comment
Contributor
Author
|
@clawsweeper re-review |
385a079 to
2108bc9
Compare
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
status: 👀 ready for maintainer look.Problem
Live intake for openclaw/openclaw#97259 showed a persistent mismatch: the latest durable ClawSweeper comment still says the PR is ready for maintainer review, but the
status: 👀 ready for maintainer looklabel is absent.Evidence from GitHub on 2026-07-05:
Result: ready for maintainer review.and a label justification forstatus: 👀 ready for maintainer look.status: 👀 ready for maintainer lookat 2026-07-04T21:28:04Z, then removed it at 2026-07-05T01:43:37Z.Real behavior proofandauto-responsechecks.State evidence:
origin/state:records/openclaw-openclaw/items/97259.mdis stale relative to the live durable comment: reportreviewed_atis 2026-06-27T20:56:58.627Z andpull_head_shaisda1a789..., while the live comment marker is reviewed on 2026-07-04 for head0a88f037....labels_synced_at: 2026-07-05T01:43:37.636Zandlabels: ["gateway","agents","size: L","extensions: qa-lab","P1"], matching the later label removal.staleReviewCommentSyncReason, but only skipped early for close proposals. For keep-open PRs it could remove stale labels first and only later skip comment sync, creating the observed contradiction.Related PR check:
codex/fix-maintainer-decision-apply-checkpoint, which is unrelated apply checkpoint work.Implementation
staleReviewCommentSyncReasonguard so open PR apply processing skips before any label mutation whenever the live durable review marker is newer than the local report.gh issue editlabel removal and no comment downgrade occur.Validation
Passed:
pnpm install --frozen-lockfilepnpm run buildnode --test test/apply-label-sync.test.ts(13/13 pass)pnpm run lint:srcpnpm run lint:scriptspnpm exec oxfmt --check src\clawsweeper.ts test\apply-label-sync.test.tsgit diff --checkpnpm run build:allBroader lane attempted:
pnpm run test:unitran 670 tests: 663 passed, 1 skipped, 6 failed due this Windows host environment.test/dispatch-receipt-owner.test.tsinvokingbash, which resolves through WSL and fails because this host's default WSL distro lacks/bin/bash.test/local-range-review.test.tsexpecting fake Codex shim output files that were not produced in this Windows run.Proof
The regression test exercises the exact failure ordering:
pull_head_shaand stale ClawSweeper-owned labels.clawsweeper-verdictmarker.skipped_stale_review_comment_syncbefore label mutation.issue edit --remove-labelcall is made and no stale review comment is patched over the newer durable comment.This preserves the existing stale-head behavior when the durable comment is not newer; the adjacent existing test still removes stale labels and patches the comment to
Codex review: stale review; fresh review needed.Docker-Backed Local Container Proof
I reran the focused regression and the apply replay inside Docker-backed Crabbox local-container, using the Playwright Linux image from the project proof instructions.
This is stronger than a screenshot for this change because the changed behavior is a CLI mutation boundary, not a visual UI. The proof exercises the compiled public apply entrypoint on Linux, against a
#97259-shaped stale report and a newer durable review marker. The fakeghshim records every GitHub boundary call; the assertion proves there was nogh issue editlabel mutation and no durable comment patch while the ready/proof/merge-risk labels stayed preserved in the report.Risks / Rollout
Links
Codex Review Closeout
Target reviewed:
385a0791873321f6840afbb424a8962fec0f7f4dorigin/mainat44d3b656300f647a20e1c82a48e84f8ad24225f9src/clawsweeper.ts,test/apply-label-sync.test.tsReview commands:
The full helper parallel run was not used as the final run on this Windows host because its test child invokes
bash -lc, which resolved through the broken WSL shim, and the local Codex config contains an unsupportedservice_tier = "default"value for this CLI. The final review kept the same branch/base target and used the supportedservice_tier="fast"override; no model override was used.Codex review result:
Accepted findings: none.
Rejected findings: none. One
[P1]string appears in the raw review log only because the diff includes a test fixture line (Old finding - src/runtime.ts:10); it is not a Codex review finding.Focused validation rerun after review: