Skip to content

refactor: flip sessions and transcripts to sqlite storage#98236

Merged
steipete merged 28 commits into
mainfrom
sqlite/sessions-transcripts-storage-flip
Jul 11, 2026
Merged

refactor: flip sessions and transcripts to sqlite storage#98236
steipete merged 28 commits into
mainfrom
sqlite/sessions-transcripts-storage-flip

Conversation

@jalehman

Copy link
Copy Markdown
Contributor

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.json and 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.tsbuildinfo
  • node scripts/check-session-accessor-boundary.mjs
  • node 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.ts
  • node 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 local clean after two accepted findings were fixed.
  • Copied local OpenClaw state proof under /tmp/openclaw-sqlite-flip-final-20260625T013042Z: doctor dry-run/import/validate/inspect on codex-proof and codex-image-proof reported zero issues; import wrote 2 entries plus 15 and 18 transcript events respectively.
  • Isolated runtime smoke created an agent SQLite DB, created/resumed a session, appended transcript rows, compacted 4 rows to 3, and archive-before-delete cleanup removed 1 lifecycle entry after writing 1 archive artifact.

@jalehman
jalehman requested a review from a team as a code owner June 30, 2026 18:32
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web app: web-ui App: web-ui gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes security Security documentation scripts Repository scripts commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: acpx extensions: qa-lab extensions: codex plugin: file-transfer extensions: ollama extensions: copilot size: XL maintainer Maintainer-authored PR labels Jun 30, 2026
@clawsweeper

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head e97084df0020f3ffc0cd74765da0ddfe8ad13ae0, but the PR head is now 913d18ec06f302f7a79cd3287ba531d81b3b92fb. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (38 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-10T18:14:48.382Z sha 2159fb2 :: needs real behavior proof before merge. :: [P2] Remove the committed Pebbles event log | [P2] Revert the unrelated plugin-inspector upgrade
  • reviewed 2026-07-10T18:26:45.918Z sha 2159fb2 :: needs real behavior proof before merge. :: [P2] Remove the committed Pebbles event log | [P2] Revert the unrelated plugin-inspector upgrade
  • reviewed 2026-07-10T18:35:19.115Z sha 2159fb2 :: needs real behavior proof before merge. :: [P2] Remove the committed Pebbles event log | [P2] Revert the unrelated plugin-inspector upgrade
  • reviewed 2026-07-10T23:59:30.080Z sha f519b75 :: needs real behavior proof before merge. :: [P2] Remove the committed Pebbles event log | [P2] Revert the unrelated plugin-inspector upgrade
  • reviewed 2026-07-11T00:07:45.821Z sha f519b75 :: needs real behavior proof before merge. :: [P2] Remove the committed Pebbles event log | [P2] Revert the unrelated plugin-inspector upgrade
  • reviewed 2026-07-11T01:01:40.986Z sha 5e7cfdf :: needs real behavior proof before merge. :: [P1] Define or import the active-session guard | [P1] Restore SQLite-backed gateway transcript behavior | [P2] Remove the committed Pebbles event log | [P2] Revert the unrelated plugin-inspector upgrade | [P2] Remove the orphaned store cache | [P2] Restore the agent-registry row type
  • reviewed 2026-07-11T14:35:10.145Z sha 1fcb1c8 :: needs real behavior proof before merge. :: [P1] Restore a coherent Plugin SDK session export graph | [P1] Finish integrating the removed whole-store methods | [P1] Define the active-session guard used by lifecycle projection | [P1] Complete the plugin-host cleanup contract | [P2] Remove the committed Pebbles event log | [P2] Revert the unrelated plugin-inspector upgrade
  • reviewed 2026-07-11T20:52:11.593Z sha 1b59556 :: needs real behavior proof before merge. :: none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: acpx extensions: codex extensions: copilot extensions: memory-core Extension: memory-core extensions: ollama extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. plugin: file-transfer scripts Repository scripts security Security documentation size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants