Repository navigation
perf(apply): memoize per-item guard reads; stabilize coalescing race test - #1060
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 7:02 PM ET / 23:02 UTC. ClawSweeper reviewWhat this changesThe PR memoizes repeated GitHub guard reads within each apply item, clears that cache at item and mutation boundaries, and makes the dashboard coalescing-race test accept either valid enqueue winner. Merge readinessThis remains a current, useful PR: the cache and reset wiring are not on current main, the earlier changelog finding is resolved, and the updated PR body supplies controlled apply-boundary proof. No blocking patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s apply lane reads GitHub state to validate a reviewed item before mutating GitHub. Apply guards supply those checks, while the dashboard worker coalesces incoming exact-review work into a stored queue item. flowchart LR
A[Apply report] --> B[Per-item apply workflow]
B --> C[Apply guard reads]
C --> D[GitHub state]
C --> E[Per-item guard cache]
B --> F[Observed mutation]
F --> E
B --> G[Apply decision]
H[Queue deliveries] --> I[Dashboard coalescing]
I --> J[Stored queue item]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the scoped cache with its reset contract intact, retaining focused coverage and the controlled apply-boundary proof for the final head. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR improves internal apply efficiency and a test’s race assertion rather than addressing a user-reported runtime reproduction. Is this the best way to solve the issue? Yes: exact-request memoization scoped to one apply item, with resets before the next item and after observed mutation, is the narrowest maintainable solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f6f6bfca7d65. LabelsLabel 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)
|
The 450/h trim ducked App installation 403s at ~30 API calls per review. Apply-guard memoization (#1060) cut that per-item cost and the read-pool split (#1062/#1064) moved router and public reads onto the Actions token pool, so the App bucket now carries only memoized hydration and writes. Post-#1064 telemetry shows ~336 ok reviews/h with near-empty throttle backoff at the 450 cap; restoring the historical 600/h uses the recovered headroom.
Summary
Proof
apply-decisionsentrypoint.pnpm test:uniton Node 24. Observable result: 1950 of 1952 tests passed; 2 skipped. Both race interleavings were verified.a17e2aa651d361708209da46da04493b08f3d951on Crabboxprovider=aws, leasecbx_fca17c765f6d, runrun_46dc6edd2324, withnode:24-bookworm. The container built the branch and invokednode dist/clawsweeper.js apply-decisions --skip-dashboard --item-number 321 --closed-dir <temp>against a controlled GitHub fixture.skipped_changed_since_review(APPLY_CACHE_PROOF=PASS).Review disposition
CHANGELOG.mdentry; release context remains in this PR body and commit history.OpenClaw Bay is unaffected: this changes internal apply-decision read reuse and a test race assertion, without changing lifecycle publication, queue controls, status/telemetry, or dashboard data contracts.