Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR drains archive-retention candidates across bounded pages while preserving 16-row deletion batches. Example: A store contains 300 older archives whose files remain and 20 later expired archives whose files are absent.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current pagination defect with a focused change, credible runtime evidence, green exact-head checks, and no actionable findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherSession lifecycle cleanup removes expired archive files, then reconciles their canonical database rows through the existing archive reader and admitted writer; Doctor checks the remaining archive manifests. flowchart TD
A[Session lifecycle cleanup] --> B[Expired archive file cleanup]
B --> C[Retention pagination owner]
C --> D[Bounded archive reader]
D --> C
C --> E[Admitted deletion batches]
E --> F[Canonical archive table]
F --> G[Doctor manifest verification]
Technical reviewBest possible solution: Merge the existing-owner pagination repair while preserving current retention rules, deletion rechecks, and foreground writer fairness. Do we have a high-confidence way to reproduce the issue? Current-main source establishes retained-prefix starvation, and the supplied runtime trace exercises that dataset through production cleanup and Doctor; this read-only review ran no target code. Is this the best way to solve the issue? Pagination repairs incomplete reconciliation at its existing owner, retains safety checks and bounded writes, and avoids suppressing valid Doctor warnings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1b94648c99f5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +19, Tests +20. Total +39 across 5 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 24, 2026, 12:34 AM ET / 04:34 UTC (Revision 3). |
Dataset for the
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Beta.5 adaptation: Apply the source behavior to the c11c9d3 baseline; preserve baseline-native producer/consumer seams and include focused regression and registration adaptations for this group. See expanded-implementation-0/receipts.json for closure and qualification. (cherry picked from commit 4db08cf) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f9e1fa5f6573b3fb86fea9f0e3cc513285d3124d)
Closes #181722
What Problem This Solves
Fixes:
doctorkeeps reporting retention-deleted transcript archive copies as missing when archive retention spans more than one 256-row page.User Impact
Operators no longer see permanent stale
Missing ... canonical transcript archive file(s)warnings after ordinary retention. Later eligible rows are no longer starved by an older retained prefix.Why This Change Was Made
Retention previously read one 256-row page and filtered it after selection. It now walks bounded pages, advances only past rows intentionally retained, and drains each page in 16-row write batches. Both worker and native SQLite paths accept the page offset. Doctor warnings for genuinely unexplained missing copies and cold-storage history are unchanged.
Evidence
Reproduction through the production retention path
The proof seeds a 300-row retained prefix with published files, then 20 later retention-eligible rows with no file. It closes the database, runs the production
sweepCronRunSessions()owner withresetArchiveRetention: "1h"and cron retention1ms, then runsopenclaw doctor --fixand reads the archive table again.Doctor scanned the remaining 300 archives and emitted no
Missing ... canonical transcript archive file(s)warning. The 300 retained-prefix rows remain; the 20 later missing rows were drained. One additional row is the cron trigger archive created while exercising the reaper.Issue dataset
The
tre1dmeasurement from #181722: an earlier weekly archive held 822 copies, one day contributed 762, and the later archive held none of those 822. There were 605 manifest/blob rows with missing files (234 / 326 / 45 per agent); every publish recorded success. Rebuilding all 605 files produced 605 writes and 0 SHA-256 mismatches.Regression coverage
7845dd3e): new regressions fail withexpected 256 to be 258andexpected 0 to be 20.7e053421): both regressions pass; the full retention file passes8/8.session-history-archive-retention, archive-pruning admission, page-reclamation binding, session reaper, cleanup missing-file handling, and transcript-directive migration).pnpm check:line-cap-ratchet,oxlint, andoxfmt --checkpass.pnpm build:runtime: TypeScript runtime and tsdown phases completed. The final UI phase failed because this host lacks the unrelatedlibdeflatepackage.No UI changes.
AI Assistance
AI-assisted implementation and validation under contributor direction and review.