Skip to content

fix: prioritize safe closures over bounded comment maintenance - #975

Merged
steipete merged 3 commits into
mainfrom
codex/clawsweeper-apply-lane-priority
Jul 31, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/clawsweeper-apply-lane-priority

Conversation

@steipete

@steipete steipete commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

What changes

  • Give genuinely actionable OpenClaw issue/PR closures a reliable opening in the serialized target apply lane: background durable-review comment maintenance is now bounded to 40 items / 5 minutes instead of monopolizing that lane for roughly an hour.
  • Preserve narrow, safe closure eligibility, immutable source checkouts, full reviewed inventory scans, and independent close-coverage evidence; include retryable close-proof records while rejecting failed reviews and missing item snapshots.
  • Keep scheduled PR comment maintenance separate from closure and from issue-linked-PR guards; preserve explicit operator item/kind/age filters and use independently scoped manual cursors.
  • Finish arbitrary-size unscheduled/manual comment-sync inventories without starvation, unsafe cursor advancement, skipped cursor wraparound, endless continuation, or continuing after cursor-state publication failed.
  • Persist only completed exact-prefix progress, retain unfinished explicit items, stop zero-progress continuations, and preserve canonical records when best-effort operational bookkeeping fails.

Real runtime proof

  • Live OpenClaw maintenance was processing approximately 1,000 durable review comments for 55 minutes inside the same serialized apply lane used by actual issue/PR closures; scheduled closure runs accumulated behind it. Cancelling the stale maintenance window immediately allowed the bot to safely close fix: skip timeout-triggered compaction when run was aborted by user openclaw#82085 at 2026-07-31T14:52:37Z as clawsweeper[bot]. A later stale maintenance run again blocked scheduled automatic closure, reproducing the same production bottleneck.
  • Real production helper/CLI-path proof populated 1,002 canonical Markdown review reports, selected eligible closure records through the actual workflow selector, included the final retry_pr_close_coverage_proof item, excluded failed/missing-snapshot reports, and proved the closure window no longer stops after a 600-record unproductive prefix.
  • Real shell + workflow utility integration proof starts from an existing cursor, performs exact-prefix checkpoint publication, resumes every bounded window across cursor wraparound until the original cycle boundary, and terminates cleanly; it also proves dedicated manual issue scopes are unaffected by the scheduled PR cursor, preserves explicit-item continuation after unrelated bookkeeping failure, refuses continuation after cursor publication failure, rejects malformed selections, and avoids empty/no-progress retry loops.
  • 150/150 focused workflow and repair utility tests passed, including exact wrap-boundary trimming without duplicate work, safe cycle reset after boundary records disappear, preservation of explicitly scoped selections, arbitrary-window cursor-wrap draining, bounded 40-record/5-minute maintenance, retryable close-coverage selection, 1,000+-item real report inventory, and production workflow body-size limits.

Directly reviewable current-head executable shell/CLI regression output:

✔ unscheduled wrapped synchronization drains every bounded window and then stops
✔ wrapped cursor state never widens an explicit comment-sync selection
✔ wrapped cursor resets when every remaining boundary record disappears
✔ manual OpenClaw issue synchronization continues beyond scheduled PR coverage
✔ unscheduled cursor synchronization never continues after cursor publication fails
✔ explicit item continuation survives unrelated cursor bookkeeping failure
tests 150 | pass 150 | fail 0

Directly reviewable observed production close after the blocked serialized lane was recovered:

item: https://github.com/openclaw/openclaw/pull/82085
action: closed
actor: clawsweeper[bot]
closed_at: 2026-07-31T14:52:37Z
  • Static checks, builds, workflow formatting, repair lint, shell syntax, and independent fresh precommit Codex review passed; the fresh review confirmed bounded synchronization, durable cursor progress, continuation safety, and retryable coverage-proof eligibility.
  • Independent precommit and committed-range Codex reviews identified and resolved every accepted cursor finding: dedicated manual cursor scopes prevent shared-cursor omission; durable cycle anchors drain arbitrary inventories; the final selected window is trimmed before mutation; explicit item requests are never widened; disappeared boundary records reset obsolete cycle state instead of stranding synchronization.

The repository owner explicitly requested automatic safe closure, simplified maintenance, automatic service-PR landing, live mutation, and end-to-end production monitoring in this session. No maintainer/protected/security close guards are weakened.

@steipete
steipete requested a review from a team as a code owner July 31, 2026 15:54
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 12:34 PM ET / 16:34 UTC.

ClawSweeper review

What this changes

This PR limits durable review-comment synchronization to bounded batches, persists exact cursor progress, and keeps safe closure selection from waiting behind long comment-maintenance runs.

Merge readiness

⚠️ Needs maintainer review before merge - 3 items remain

Keep this PR open for maintainer review. Its body provides credible current-head terminal and production evidence for the closure-delay bottleneck, but this checkout is a blobless partial clone and could not load the PR’s complete tree after the unavailable promisor remote prevented object retrieval; source-level cursor and continuation verification therefore cannot be claimed.

Likely related people

  • Peter Steinberger — high confidence; recent central contributor to the apply workflow, repair queue, and cursor-related maintenance paths.

Priority: P2
Reviewed head: 268e2651d1f67fa31dc7f10a0f11506f5d3ffe62

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The runtime proof is strong, while patch quality remains provisional because this review could not load the complete PR source tree.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body includes a redaction-safe observed production close after recovering the blocked lane plus current-head terminal output for the bounded cursor paths; this is meaningful after-fix runtime evidence.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body includes a redaction-safe observed production close after recovering the blocked lane plus current-head terminal output for the bounded cursor paths; this is meaningful after-fix runtime evidence.
Evidence reviewed 4 items Current main already has cursor-based comment synchronization: Current main’s apply workflow uses a comment-sync cursor path and writes it after a comment-maintenance checkpoint; the PR changes this existing operational path rather than introducing an unrelated subsystem.
Current selector owns comment-sync eligibility: The current-main workflow utility contains the comment-sync candidate selector, and the supplied PR diff narrowly extends its accepted retry action set.
PR history and ownership trail: The PR consists of three commits based directly on current main: the initial bounded-sync change, a wrapped-cycle-boundary fix, and a test assertion cleanup. Peter Steinberger also authored the recent current-main apply and repair workflow changes sampled in file history.
Findings None None.
Security None None.

How this fits together

ClawSweeper’s serialized apply lane reads durable review records, updates the durable GitHub review comment, and performs narrowly eligible close actions. The changed workflow and shell helper choose comment-sync batches and persist cursors so background maintenance yields regularly to closure work.

flowchart LR
  A[Durable review records] --> B[Apply workflow]
  B --> C[Comment-sync batch selection]
  C --> D[Cursor checkpoint]
  D --> E[Durable comment updates]
  B --> F[Safe closure selection]
  F --> G[GitHub close actions]
Loading

Before merge

  • Resolve merge risk (P1) - The complete PR workflow, shell helper, and test blobs could not be loaded from this checkout, so a regression in wraparound trimming, cursor publication ordering, or continuation handling remains unverified despite the supplied proof and green checks.
  • Resolve merge risk (P1) - This change alters the serialized apply lane; an error could delay safe closures, duplicate comment maintenance, or strand cursor progress until operator intervention.
  • Complete next step (P2) - A maintainer should obtain a source-complete current-head review before merge because this read-only partial checkout cannot inspect the full changed implementation.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 1,240 additions, 25 deletions across 5 files The change spans workflow orchestration, shell state handling, selector eligibility, and two focused test suites.
Claimed focused validation 150 passed, 0 failed The PR body reports focused workflow and repair-utility coverage, including cursor wraparound and publication-failure paths.

Merge-risk options

Maintainer options:

  1. Review from a complete checkout (recommended)
    Fetch or use a complete checkout to inspect the current workflow, helper, and regression tests before merging this apply-lane behavior change.
  2. Accept the production-proof tradeoff
    A maintainer may accept the supplied live production and focused-test evidence despite the unavailable local source inspection, while owning the cursor and continuation regression risk.

Technical review

Best possible solution:

Re-run a source-complete review of the current head, then land the bounded cursor design only if its exact-prefix publication and zero-progress stop behavior match the reported runtime proof.

Do we have a high-confidence way to reproduce the issue?

No direct local reproduction was completed: the PR body records a live production closure delay and after-fix terminal output, but the complete current-head source could not be loaded in this partial checkout to independently trace the path.

Is this the best way to solve the issue?

Unclear: bounded synchronization with exact-prefix cursor checkpoints is a plausible narrow repair, but the complete current-head implementation must be inspected before confirming it is the safest solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c319ba7b34e1.

Labels

Label justifications:

  • P2: The patch changes closure-processing automation with bounded operational blast radius and a documented production delay scenario.
  • merge-risk: 🚨 automation: The workflow and helper changes alter scheduled batching, persisted cursors, and continuation behavior for automated review-comment and closure processing.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes a redaction-safe observed production close after recovering the blocked lane plus current-head terminal output for the bounded cursor paths; this is meaningful after-fix runtime evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes a redaction-safe observed production close after recovering the blocked lane plus current-head terminal output for the bounded cursor paths; this is meaningful after-fix runtime evidence.

Evidence

What I checked:

  • Current main already has cursor-based comment synchronization: Current main’s apply workflow uses a comment-sync cursor path and writes it after a comment-maintenance checkpoint; the PR changes this existing operational path rather than introducing an unrelated subsystem. (.github/workflows/sweep.yml:5007, c319ba7b34e1)
  • Current selector owns comment-sync eligibility: The current-main workflow utility contains the comment-sync candidate selector, and the supplied PR diff narrowly extends its accepted retry action set. (src/repair/workflow-utils.ts:2176, c319ba7b34e1)
  • PR history and ownership trail: The PR consists of three commits based directly on current main: the initial bounded-sync change, a wrapped-cycle-boundary fix, and a test assertion cleanup. Peter Steinberger also authored the recent current-main apply and repair workflow changes sampled in file history. (scripts/apply-workflow-helpers.sh:1, 268e2651d1f6)
  • Complete patch inspection was unavailable: The commit objects are present, but their trees and changed blobs are absent from this blobless checkout. Attempting to load the range or PR paths required the promisor remote, which was unreachable, so the complete workflow/helper/test implementation could not be reviewed locally. (268e2651d1f6)

Likely related people:

  • Peter Steinberger: The three PR commits are authored by Peter Steinberger and recent current-main history shows sustained work on the apply lane, repair queue, and workflow scheduling surfaces. (role: recent area contributor and PR author; confidence: high; commits: 98eb549ba12d, a9043c614891, c319ba7b34e1; files: .github/workflows/sweep.yml, scripts/apply-workflow-helpers.sh, src/repair/workflow-utils.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Make the current head available from a complete checkout and repeat the focused source-level review of cursor wraparound, publication failure, and continuation behavior.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-07-31T15:57:58.840Z sha ab640f5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-31T16:06:11.316Z sha fc8edd4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-31T16:28:48.347Z sha 268e265 :: needs maintainer review before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 31, 2026
@steipete
steipete force-pushed the codex/clawsweeper-apply-lane-priority branch from fc8edd4 to 268e265 Compare July 31, 2026 16:25
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 31, 2026
@steipete
steipete merged commit 0ee212e into main Jul 31, 2026
20 checks passed
@steipete
steipete deleted the codex/clawsweeper-apply-lane-priority branch July 31, 2026 16:36
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…law#975)

* fix: prioritize closures over bounded durable comment synchronization

* fix: finish wrapped maintenance exactly at durable cycle boundary

* test: remove unnecessary escaping in wrapped cursor assertion

---------

Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant