Repository navigation
fix(sessions): isolate fresh creation from unrelated archive exports - #148958
Conversation
Skip unrelated pending archive publication for fresh session upserts with maintenance disabled. Preserve publication for existing entries, resets, removal retries, maintenance, and Doctor work. A real archive collision reproduces creation failing after its session row and transcript committed; verify successful creation and later archive recovery through the lifecycle entry points. Related: #130741
|
🦞👀 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. Reviewed September 17, 2026, 11:15 AM ET / 15:15 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR prevents fresh session creation from retrying unrelated archive exports, adds creation and recovery regressions, and documents how to retry failed exports. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still couples fresh session creation to unrelated archive-export failures. No blocking defect was found, and the protected maintainer PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s session lifecycle owner commits session changes and retains deleted transcripts as canonical SQLite archives. A separate publication step exports those archives to files; this change controls which lifecycle operations invoke that step. flowchart TD
A[Session lifecycle request] --> B[Validate and commit SQLite changes]
B --> C{Fresh creation only?}
C -->|Yes, maintenance disabled| D[Return creation success]
C -->|No| E[Publish pending archive files]
F[Canonical SQLite archives] --> E
E --> G[Record success or retryable failure]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +16, Tests +162, Docs +6. Total +184 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep fresh creation independent of unrelated exports while preserving canonical archive bytes and the existing explicit recovery operations. Do we have a high-confidence way to reproduce the issue? Yes, from source: leave a deleted session’s export pending through a file collision, then create an unrelated session with maintenance disabled. Current main retries that export after committing creation; this review did not execute the scenario. Is this the best way to solve the issue? Yes. The condition belongs in the existing lifecycle owner and preserves removal retries, existing-entry updates, maintenance, and Doctor recovery without adding configuration or changing stored formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1ee713eed0bd. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Merged via squash.
|
…148958) Skip unrelated pending archive publication for fresh session upserts with maintenance disabled. Preserve publication for existing entries, resets, removal retries, maintenance, and Doctor work. A real archive collision reproduces creation failing after its session row and transcript committed; verify successful creation and later archive recovery through the lifecycle entry points. Related: openclaw#130741
Related: #130741
What Problem This Solves
Creating a fresh session can report an unrelated archive-export failure after its session row and transcript have already committed.
User Impact
Fresh sessions can be created independently of failed exports from other sessions. Those archives remain recoverable through the existing deletion and retry paths.
Why This Change Was Made
Fresh upserts with maintenance disabled do not own unrelated archive recovery. Skip only that publication path; existing entries, resets, removal retries, maintenance, Doctor work, and empty retries retain their required publication behavior.
Evidence
The archive-path collision regression proves creation succeeds while preserving the pending archive bytes, followed by successful recovery on deletion retry. All six complete regression and sibling suites passed (38 tests), together with canonical checks, in a clean Linux Testbox using Node 24.19 and pnpm 12.4. The candidate source tree and every tracked file were verified before and after installation, tests, and checks. The Testbox command exited successfully and its lease completed.