Repository navigation
fix(doctor): settle imported JSONL transcript leftovers - #154413
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. Reviewed September 21, 2026, 7:28 AM ET / 11:28 UTC (Revision 4). ClawSweeper reviewWhat this changesDoctor verifies and archives leftover JSONL conversation files, safely imports missing trailing history, keeps failures scoped to each agent, and explains skipped noninteractive issue reporting. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful repair absent from inspected main. No actionable introduced defect was found, and the recorded updater evidence addresses the previous upgrade-proof request. Priority: P0 Review scores
Verification
How this fits togetherDoctor repairs OpenClaw’s stored session history during maintenance and updates. It compares legacy conversation files with each agent’s SQLite database, then records verified archival or a specific recovery finding. flowchart TD
A[Doctor or update recovery] --> B[Find leftover conversation files]
B --> C[Compare identity and ordered history]
D[Agent SQLite database] --> C
C --> E[Import safe missing suffix]
E --> C
C --> F[Archive verified original with receipt]
C --> G[Retain conflicting original and report]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +247, Tests +289, Docs +11, Other +1. Total +548 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep settlement within Doctor’s existing verifier, importer and receipt owners, preserving current session settings and retaining any original whose history cannot be safely verified. Do we have a high-confidence way to reproduce the issue? Yes, from source: imported JSONL files outside a later retained-source receipt reach the active-file diagnostic without a settlement path on inspected main. The contributor also records a failing original-code replay; this reviewer did not execute it. Is this the best way to solve the issue? Yes. Extending the existing content verifier and historical-only importer avoids count-only archival, stale metadata replay, and a competing recovery mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2cc189c8735f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Verify leftover active JSONL contents against the owning SQLite session, import only an appendable suffix, and archive originals with existing recovery receipts. Preserve current session metadata, partial-publication recovery, and per-agent diagnostics.\n\nFixes #154277. Thanks @cortanapham for the report.
36a9f2f to
d433787
Compare
* commit '0883394977d1fb3af657635967f6e447bd7fff9a': (72 commits) fix(ui): await scheduled rail layout in focus test fix(cron): keep healthy active runs from delaying job lists (#154421) fix(plugins): prevent config conflicts during legacy plugin installation (#154539) perf(gateway): reduce repeated session-list work (#154551) fix(tasks): retain admitted work across list retries (#154338) perf(gateway): speed up transcript artifact downloads (#154726) chore(ui): refresh control ui locales (#154580) fix(release): keep two extended-stable months eligible (#154777) fix(tests): avoid avatar descriptor reuse race (#154747) perf(plugins): reduce callback scope overhead (#154625) fix(ui): include final request time in completed work summaries (#149240) fix(ai): avoid retrying conflicting Responses terminal statuses (#149242) fix: identify malformed Code Mode JavaScript as input errors (#149222) fix(doctor): settle imported JSONL transcript leftovers (#154413) fix(cloud): restore node bootstrap with bundled browser runtime (#154654) test(ui): await publication state notifications (#154768) fix(plugins): keep unchanged plugins running across metadata refreshes (#151281) fix: keep chat panel accessibility targets within each pane (#153478) fix: forced Gateway restarts cancel healthy subagent work (#154300) improve: reduce session delivery reader imports (#154740) ...
Coalesce trusted identical archive claims through the recovery journal, redirect retained migration manifests without losing import acknowledgments, and preserve session warnings through Doctor and the installed updater. Recover uses the same settlement for historical-only stores. Fixes #155095. Related: #154413. Thanks @fozzels-assistant for the detailed report.
) * fix(doctor): settle imported JSONL transcript leftovers Verify leftover active JSONL contents against the owning SQLite session, import only an appendable suffix, and archive originals with existing recovery receipts. Preserve current session metadata, partial-publication recovery, and per-agent diagnostics.\n\nFixes openclaw#154277. Thanks @cortanapham for the report. * fix(ci): register Doctor settlement tests under SQLite recovery Route active-settlement through the existing SQLite recovery owner instead of the generic Doctor session fallback. Keep the planner regression explicit about the owning shard and exact filename. Refs openclaw#154413. No Doctor runtime changes relative to d433787.
…155194) * fix(doctor): settle byte-identical duplicate session import archives Coalesce trusted identical archive claims through the recovery journal, redirect retained migration manifests without losing import acknowledgments, and preserve session warnings through Doctor and the installed updater. Recover uses the same settlement for historical-only stores. Fixes #155095. Related: #154413. Thanks @fozzels-assistant for the detailed report. * fix(ci): register session archive recovery owner
…penclaw#155194) * fix(doctor): settle byte-identical duplicate session import archives Coalesce trusted identical archive claims through the recovery journal, redirect retained migration manifests without losing import acknowledgments, and preserve session warnings through Doctor and the installed updater. Recover uses the same settlement for historical-only stores. Fixes openclaw#155095. Related: openclaw#154413. Thanks @fozzels-assistant for the detailed report. * fix(ci): register session archive recovery owner
Closes #154277. Thanks @cortanapham for the detailed report and verification.
What Problem This Solves
Fixes repeated
doctor --fixrefusal when old JSONL transcripts already imported into SQLite remain outside a later plugin-import receipt. Recovery previously reported no moves, and a clean agent could receive another agent's settlement failure.User Impact
Doctor and session recovery verify those originals, import an appendable missing suffix when necessary, and archive verified bytes with the existing migration receipts. Current session settings and newer SQLite history stay authoritative. Conflicting identities or ordering remain protected and named; no options, dependencies, or schema changes are introduced.
Why This Change Was Made
The retained-import shortcut skipped uncaptured originals while a separate diagnostic blocked them. Settlement now uses the existing content verifier, importer, and archive publication owner. Advisory severity no longer authorizes index archival: an index stays live while an active original remains; interrupted and missing-source recovery retain their existing receipt semantics. Failures stay with the owning agent. Noninteractive GitHub-report handling also records why creation was skipped; existing
--yesauthorization remains supported.Evidence
node scripts/check-changed.mjspassed, and the runtime build passed. Validation lease,tbx_01m30xxn72g5v03xypjxz1e5zd.--maxWorkers=1, 22.066s wall / 4.775s test execution. Changed retained-source and Doctor-command files took 11.551s and 0.050s test time in the full run. The existing large migration suite took 180.8s (previously 189.5s); its performance work belongs to C3/improve(test): reduce Doctor SQLite test time #153929.doctor --fix --yes --non-interactivereached “Doctor complete.” A separatedoctor --session-sqlite recover --session-sqlite-all-agents --json --yes --non-interactiveexited 0, verified six events, and archived two leftovers. Read-only SQLite and receipt checks proved unchanged events, byte-identical archives, and no cross-agent failure on the clean third agent. All state, config, plugins, and ports were synthetic and isolated.4e2677d12b6db158ebff3a9be939c2f4d6c0e7df38fdd56dde56260a1178e9fa.The six sibling regressions found during development are resolved: referenced indexes remain live after failed publication; interrupted publication and disappeared-source recovery retain their original receipt semantics; recovery JSON keeps its optional-field shape; header-only known sessions settle; unsupported fragments remain protected. Early live fixtures were corrected to keep the plugin inventory stable and bundled Doctor modules available; the successful runs above use fresh state.
Production +400/-153 LOC; tests +322/-34; docs +14/-3. The only extraction is the existing archive-path planners; verifier, importer, publication, and recovery receipts retain their existing owners.
CI ownership registration follow-up
The red planner check on
d433787d475was reproduced: active-settlement fell through to the generic Doctor-session owner, producing 27 files against its explicit 26-file inventory. It is now registered by name inresolveCommandShardNameunder the existingagentic-commands-doctor-sessions-cron-sqlite-recoveryowner alongside receipt recovery and missing-index verification. The test names the file in that owner and retains complete, duplicate-free coverage and isolation checks.Testbox
tbx_01m31s3d3zj462x3zx3fytvfyp: all 119 planner tests passed (81.48s Vitest wall / 75.614s test time), the original Doctor set passed 301 tests with 2 existing platform skips, and scopedcheck:changedpassed. The planner file exercises complete repository inventories and supported compact-plan profiles; no cases, assertions, or budgets were weakened. P1 review had no actionable findings.Interdiff from
d433787d475: CI planner +1/-0 line, planner test +1/-0 line;src/**unchanged. Head27ee0591f7be88283723361ae098e310b678eee3; CI run is attached. Auto-merge remains disabled for lead review; this update does not land the PR.