refactor: flip sessions and transcripts to sqlite storage#96625
refactor: flip sessions and transcripts to sqlite storage#96625jalehman wants to merge 292 commits into
Conversation
|
Codex review: found issues before merge. Reviewed June 30, 2026, 2:28 PM ET / 18:28 UTC. Summary Reproducibility: yes. from source inspection: explicit sessionFile targets remain valid, but the PR run path now invokes a SQLite-only runtime transcript truncation helper that returns without truncating non-SQLite targets; no tests were run because this was a read-only review. Review metrics: 3 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Repair explicit-file overflow truncation, resolve the merge conflict, and land only after maintainers accept the SQLite storage/API/doctor cutover with fresh upgrade proof. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: explicit sessionFile targets remain valid, but the PR run path now invokes a SQLite-only runtime transcript truncation helper that returns without truncating non-SQLite targets; no tests were run because this was a read-only review. Is this the best way to solve the issue? No as-is: the storage-flip direction matches the tracker, but the patch needs the explicit-file truncation repair plus refreshed merge and upgrade proof before it is the best landing shape. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 786abe78df53. Label changesLabel justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Behavior proof for the storage flip follow-up at
Live local migration proof against Josh's local OpenClaw store:
Local verification:
Thermonuclear review note: the behavior fixes are materially cleaner now, but the strict maintainability review still flags the large SQLite backend/test shape from the broader branch ( |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Pass runtime context into context-engine bootstrap and use SQLite-aware transcript state checks for bootstrap gating.
Keep SQLite transcript markers out of file-backed startup preparation while still allowing existing SQLite message rows to trigger context-engine bootstrap.
|
Superseded by #98236, which carries the same SQLite sessions/transcripts storage flip on canonical upstream branch |
What Problem This Solves
Completes the session/transcript storage flip tracked by #88838 by making per-agent SQLite the canonical runtime store for session metadata and transcript events. Legacy
sessions.jsonand active transcript JSONL files are now doctor import inputs or archive artifacts, not runtime fallback state.Why This Change Was Made
The accessor seams from the earlier work made a single storage flip practical. Shipping a mixed file/SQLite runtime would let session metadata and transcript rows drift, so this PR moves import, runtime access, retention, SDK cleanup, and ratchets together behind the permanent accessor boundary.
User Impact
Existing legacy session stores can be migrated non-destructively through doctor dry-run/import/validate/inspect flows. Runtime session creation, resume, transcript append, compaction, and maintenance use SQLite rows; retention still exports archived JSONL artifacts before deleting rows so support and archive workflows keep inspectable artifacts.
Evidence
node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfonode scripts/check-session-accessor-boundary.mjsnode scripts/run-vitest.mjs src/config/sessions/session-accessor.test.ts src/config/sessions/targets.test.ts src/commands/doctor-session-sqlite.test.ts test/scripts/check-session-accessor-boundary.test.ts src/plugin-sdk/session-store-runtime.test.ts src/config/sessions/session-accessor.conformance.test.ts src/config/sessions/store.session-lifecycle-mutation.test.ts src/plugins/contracts/host-hooks.contract.test.ts src/plugins/contracts/session-entry-projection.contract.test.ts src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.tsnode scripts/run-oxlint.mjs src/config/sessions/session-accessor.test.ts src/config/sessions/targets.ts src/config/sessions/targets.test.ts src/commands/doctor-session-sqlite.test.ts.agents/skills/autoreview/scripts/autoreview --mode localclean after two accepted findings were fixed./tmp/openclaw-sqlite-flip-final-20260625T013042Z: doctor dry-run/import/validate/inspect oncodex-proofandcodex-image-proofreported zero issues; import wrote 2 entries plus 15 and 18 transcript events respectively.