refactor: flip sessions and transcripts to sqlite storage#98236
Merged
Conversation
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (38 earlier review cycles; latest 8 shown)
|
This was referenced Jun 30, 2026
This was referenced Jul 12, 2026
This was referenced Jul 12, 2026
Closed
This was referenced Jul 12, 2026
This was referenced Jul 13, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #96625
Related: #88838
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.