Repository navigation
fix(review): recover orphaned review-started placeholders via the reconcile sweep - #661
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40c051ecfe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const comments: ReviewPlaceholderComment[] = []; | ||
| for (let page = 1; page <= COMMENT_MAX_PAGES; page += 1) { | ||
| const pageComments = await github<ReviewPlaceholderComment[]>( | ||
| `/repos/${repo}/issues/${number}/comments?sort=created&direction=desc&per_page=${COMMENT_PAGE_SIZE}&page=${page}`, |
There was a problem hiding this comment.
Fetch newest issue comments before applying the cap
For issues/PRs that already have more than 200 comments before ClawSweeper posts the placeholder, this fetch will not see the placeholder: GitHub documents the issue-specific comments endpoint as ordered by ascending ID, and the sort/direction parameters are not supported there (https://docs.github.com/rest/issues/comments#list-issue-comments). Because the recovery only reads the first two pages, high-activity items found by search can be skipped or evaluated against an old bot comment instead of the latest one; use an endpoint/query that really returns newest comments first or paginate from the end before capping.
Useful? React with 👍 / 👎.
…oncile sweep (openclaw#661) * feat(review): placeholder-recovery module and tests * ci(reconcile): run placeholder recovery on the 15-minute sweep
Why
Public incident (openclaw/openclaw#88312, complained about on X): a "ClawSweeper status: review started" placeholder sat un-edited for 13+ hours. Root cause chain: the item's review artifact was terminal-dropped as stale, and its follow-up
source_drift_requeuewas shed by the backpressure gate during the 400+-item backlog spike — the item left the queue while its placeholder stayed up, with nothing due to touch it until the weekly cadence.What
A recovery watchdog riding the existing 15-minute reconcile sweep:
review_placeholder_recovery— deliberately NOT in the low-priority shed set, verified by a queue test that it is admitted at soft-limit depth (unknown actions are conservatively admitted). Enqueue dedupe/merge makes it idempotent against live items.Review history
Codex build + 219 tests green (orphan detection incl. active-recovery boundary, runner with mocked search/comments/enqueue, caps, queue-admission). Two consciously documented exceptions: (1) the autoreview bundle scanner fail-closes on the module's own repeated HMAC-template string — a self-referential false positive; the diff contains only env reads and computed signatures (grep-verified, no literal secret), and the module half was line-by-line reviewed by the maintainer-side session including one real bug found and fixed there (orphan age must use latest activity, not created_at). (2) The workflow-half review's only finding re-claims
actions/checkout@v7does not exist — rejected with repo evidence (53 workflows run v7 in production daily).