Repository navigation
fix: skip exact reviews superseded before generation starts - #1668
Conversation
Check the existing full lease tuple before ordinary or oversized generation. Preserve active heartbeat cadence, process cleanup, and publication fences; keep uncertain ownership as a failed attempt rather than supersession. Co-authored-by: VACInc <[email protected]> Co-authored-by: vincentkoc <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
OpenClaw-Publication: 2ec3f57c-5af9-4130-8e93-aafa22849c80 Co-authored-by: VACInc <[email protected]> Co-authored-by: vincentkoc <[email protected]>
b9fb82e to
f834571
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed September 23, 2026, 6:48 PM ET / 22:48 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch adds a lease check immediately before ordinary and oversized exact-review generation, with workflow tests and before-and-after proof. Merge readiness⛔ Blocked before merge - 3 items remain Current main still permits a superseded review to reach generation, so this PR remains useful. The guard appears correct and has relevant behavior proof. The added coordinator request creates an outage tradeoff that needs explicit maintainer acceptance before merge. Priority: P2 Review scores
Verification
How this fits togetherThe exact-review queue leases a GitHub Actions run to review an item. The workflow checks that lease with the coordinator before starting generation, then sends successful results toward publication. flowchart LR
A[Queued review] --> B[Leased Actions run]
B --> C[Setup and admission]
C --> D[Coordinator lease check]
D -->|Current lease| E[Review generation]
D -->|Stale or unavailable| F[Skip or queue recovery]
E --> G[Finalization and publication]
Decision needed
Why: Existing policy supports failing closed on unavailable authority, but it does not explicitly approve adding this new mandatory request and its extra opportunity to spend the failure budget. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the prelaunch authority fence and make its failure-budget consequence an explicit owner-approved part of the queue recovery contract. Do we have a high-confidence way to reproduce the issue? Yes. The recorded baseline workflow-shell proof shows both stale generation paths launching, and current main retains those guardless entry points; this read-only review did not rerun the fixture. Is this the best way to solve the issue? Yes. Checking the full existing lease tuple directly before each generation command is a narrow repair; the outage disposition still needs owner acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a3840356d894. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review The main PR body now traces the existing reservation/finalization authority requirements and durable failure budget, distinguishes infrastructure failure from supersession, and records the engineering disposition without asserting a separate human waiver. The exact-head 12-case behavior proof and seven existing queue budget controls were rerun; source head is unchanged. |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Fixes: an exact-review generation step can launch work before discovering that its queue lease was superseded before the step started.
User Impact
Already-superseded reviews skip generation rather than briefly starting expensive work. This is a narrow launch-boundary fix: earlier checkout/setup can still continue, and ordinary active reviews retain the existing one-minute polling interval plus request and termination time. Oversized generation remains synchronous; post-launch revocation is caught at finalization rather than interrupted mid-command.
Why This Change Was Made
Check the existing full item/lease/revision/generation/run/attempt/head tuple synchronously before either ordinary or oversized generation. Known ownership rejection is a successful no-op; unavailable authority fails before launch and remains eligible for normal queue recovery. The immediate background heartbeat for ordinary reviews, process-group cleanup, finalization, and publication authority remain unchanged.
Accepted Codex finding: the oversized path had setup after the first version of the check. The check now runs after that refresh, directly before generation, with a regression that fails on the first implementation.
The extra cost is one heartbeat request per generation entry, using the existing bounded retry helper—not a shorter polling loop. No new queue schema, configuration, permission, or cancellation API is introduced.
Startup-outage disposition
Retain the existing fail-closed authority policy; this is an engineering disposition, not a claim of a separate human waiver. The extra launch check can discover an outage earlier, but unavailable authority already fails review reservation before compute and the preexisting finalization heartbeat after compute (baseline workflow, finalization). The owning scheduler contract already classifies exhausted authority/fence failures as infrastructure
queue_completion_failure, including reviews that never start.The startup call uses the existing four-attempt transport/5xx retry helper. On exhaustion it neither launches generation nor claims supersession. Accepted failure completion uses the unchanged general workflow-recovery budget: delays begin at 30 seconds, grow to a five-minute cap, and the eighth failure parks the item; parked recovery has the existing jittered 5/10/20-minute ladder and can ultimately require operator recovery. This is not a guaranteed bounded end-to-end delay during an outage. Queue completion owner.
A budget-free
coordinationdeferral would change that established authority-outage policy rather than repair the launch fence; this small PR deliberately does not introduce that exception. Letting unverifiable ownership launch would defeat the requested guard. The residual extra request and possible earlier failed attempt remain documented, with no changed schema, retry limits, publication authority, or deployed settings. Seven focused existing queue budget/deferral controls passed; the 12-case workflow proof covers recovered 503, exhausted service/transport failure, and current-owner progress.OpenClaw Bay Impact
None. Existing superseded/failure outputs are reused; observer fields, routes, and controls do not change.
Documentation Impact
Reviewed
docs/orchestration.md,docs/pr-review-comments.md,docs/scheduler.md, anddocs/limits.md. Updated the active limits contract with launch behavior, cost, and remaining latency. Added historical before/after evidence and a repeatable isolated proof recipe.Evidence
pnpm check, network smoke, sparse repair builds, and Windows launcher. CodeQL and automerge e2e also passed onf83457131f986c04abdbf0a2de5732e93aec8c01.fe812d2ba9877d5406ab2aa85fa68a590d5ecdf0461c3c4ead96b84aa3bebc16matches the committed receipt.pnpm run check: not green — 6,641 passed, 3 failed, 19 skipped. Static checks, builds, lint, and focused coverage checks passed. The same three failures reproduce with unchanged6500b62baseline inputs: drift-refresh fixture (ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND), retirement argument-route fixture (retirement_failed), and corrupt-scanner-download fixture (unexpected exit 0). No unrelated fixes are included.6500b62dfd4c4efb0e2b821c1e9c427e128febef: no remaining actionable findings. The accepted oversized-setup finding is fixed and regression-covered. Runtime validation was executed outside the reviewer sandbox.Real Behavior Proof
Claim: already-stale authority cannot start either generation path; current ownership can proceed; uncertainty cannot be relabeled supersession.
Exercised surface: the actual extracted workflow Bash, real curl/retry helper, full-tuple HTTP payload, native process groups, and existing no-publication output gate.
Scenario/environment/command: isolated Linux/Node 26.8.2, loopback HTTP coordinator fixtures, and harmless process-tree work at the expensive review command boundary. Run
pnpm run build:all, thennode scripts/e2e/exact-review-start-authority.mjs 6500b62dfd4c4efb0e2b821c1e9c427e128febefandnode scripts/e2e/exact-review-start-authority.mjs.Observed: baseline starts both stale paths; candidate starts neither. Twelve candidate controls cover inactive owners, unknown conflicts, exhausted service/transport failures, successful retry, invalid tuples, current owners, revocation during the oversized GitHub refresh before launch, and post-start revocation with both fixture processes reaped.
Artifact: proof recipe and before/after receipts, including the exact workflow hashes.
Limits: synthetic coordinator responses and review work, not a model run, hosted Actions, production Worker, or real GitHub publication. Existing queue ordering and publication implementation are not changed or reproved. This check is not atomic with process creation and does not promise immediate cancellation. No production runs, apply/close actions, deployment, or merge were performed.
Contributor credit
Requested by Vincent Koc. Commit co-author trailers credit VACInc and vincentkoc.
Work sessions
View the OpenClaw team session