Repository navigation
refactor(doctor): retire unused transcript writer - #143772
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: blocked before merge. Reviewed September 10, 2026, 9:21 AM ET / 13:21 UTC (Revision 5). ClawSweeper reviewWhat this changesRemoves Doctor’s unused standalone transcript writer, moves retained repair tests to SQLite import, and corrects documentation about preserving original transcript files. Merge readiness⛔ Blocked before merge - 1 item remains Useful cleanup remains absent from current main, and no introduced correctness defect was found. The previous compatibility blocker is resolved: the supported migration path and stored-data transformations are unchanged. Priority: P3 Review scores
Verification
How this fits togetherDoctor imports legacy conversation files into OpenClaw’s SQLite session store. Advisory inspection reports problems, while the canonical importer repairs eligible history and archives the original files. flowchart TD
A[Legacy conversation files] --> B[Advisory inspection]
B --> C[Health findings]
A --> D[Doctor repair command]
D --> E[SQLite staging and repair]
E --> F[Canonical session database]
F --> G[Archive original files]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -134, Tests -203, Docs -1. Total -338 across 10 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep SQLite import as the sole repair owner, with nonmutating inspection and regression coverage at the importer boundary. Do we have a high-confidence way to reproduce the issue? Not applicable: the current proposal retires unused code rather than fixing a newly demonstrated runtime failure. Is this the best way to solve the issue? Yes. Removing the unused writer and exercising retained contracts through the existing importer is the narrowest maintainable approach. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c973fe7e7219. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
7302cde to
0bfc502
Compare
0bfc502 to
fb7900c
Compare
|
Merged via squash.
|
Related: #140296.
What Problem This Solves
Reduces duplicate maintenance code in Doctor while preserving its supported session-import behavior.
Why This Change Was Made
Public Doctor already repairs legacy transcripts through staged SQLite import. Remove the unused explicit-directory JSONL rewrite/backup path, its persistence-only projection, and the tests that kept that second writer alive. Retained branch and provider cases now exercise the canonical importer; advisory inspection remains nonmutating.
This builds on @ylcn91’s #140296. Its deferred-normalization implementation and both six-event regressions remain unchanged.
User Impact
The supported CLI behavior stays the same: branch/provider repair happens during staged import, and original JSONL files are archived intact. Two documentation passages now describe that behavior accurately. The existing limitation for already-partial destinations remains: recovery does not reconstruct original physical order or active-history projection.
Evidence
1670c5a1, all 88 focused owner/Doctor tests, both repaired docs suites (32 tests), and four additional transcript-reader tests passed. The full reviewed patch, all ten changed-file blobs, the staging owner, and both contributor regressions remain byte-identical. Fresh hosted CI is required for the refreshed head.1670c5a1: 128 fewer production code lines and 165 fewer test/support code lines; 338 fewer physical lines across ten files. The SQLite staging owner has zero diff.Compatibility evidence: The SQLite staging module and the canonical
noteSessionSqliteMigrationHealth,normalizeLegacyOpenAICodexTranscriptMetadata, andtranscriptRepairUserKeybodies are byte-identical to both baseline main71b21c88and integrated main1670c5a1; no schema or canonical stored-row transformation changes. The same 17 importer cases and two real Doctor cases passed before and after retirement. They verify branch/provider repair, complete event and parent links, opaque/parentless append cursors, reopen/append continuity, unchanged source bytes, and intact original archival. Both contributor six-event regressions remain unchanged. The already-partial history ordering limitation described above remains in place.