Skip to content

feat(storage): make SQLite the default session metadata store - #1372

Merged
likun666661 merged 2 commits into
apache:mainfrom
likun666661:agent/sqlite-session-metadata-default
Jul 23, 2026
Merged

feat(storage): make SQLite the default session metadata store#1372
likun666661 merged 2 commits into
apache:mainfrom
likun666661:agent/sqlite-session-metadata-default

Conversation

@likun666661

Copy link
Copy Markdown
Member

Part 2 of #1370.

Depends on #1371. Please review/merge that foundation PR first; this is a stacked draft PR and will temporarily show the Part 1 commits until its dependency lands.

What changes

  • Makes createSessionStore() use SQLite as the canonical store for all SessionHeader metadata.
  • Atomically imports existing JSONL line-1 headers into a dedicated sessions.sqlite database on startup.
  • Keeps JSONL as the transcript body store during the compatibility window; metadata updates no longer rewrite the legacy header.
  • Adds deletion tombstones so a leftover legacy transcript cannot resurrect a removed session after a crash.
  • Preserves session listing, recovery validation, connection-lock self-healing, archive/flag/read/title operations, and transcript previews.
  • Closes the SQLite handle during desktop and CLI shutdown.
  • Keeps session metadata in sessions.sqlite rather than runtime.sqlite, so this cutover does not implicitly change the existing opt-in RuntimeEvent rollout.

Compatibility boundary

Fresh sessions still receive a frozen legacy header as the JSONL first record. SQLite is authoritative immediately; Part 3 will replace that record with an explicit transcript marker and add export/downgrade/backup coverage.

Validation

  • npm test --workspace @maka/storage: 435 passed, 1 skipped
  • npm run build:test: passed across all workspaces and desktop bundles
  • npx biome lint on all 11 changed files: passed
  • git diff --check: passed
  • npm run test:dist: storage and other workspaces passed; @maka/runtime has 2 unrelated macOS sandbox/toolchain failures (hard-coded /usr/local executable-root expectation and Homebrew rg blocked from loading PCRE2). Runtime result: 2377 passed, 7 skipped, 2 failed.

Closes the default-cutover portion of #1370.

@likun666661
likun666661 force-pushed the agent/sqlite-session-metadata-default branch from 5a48723 to 93fd480 Compare July 23, 2026 06:40
@likun666661
likun666661 marked this pull request as ready for review July 23, 2026 06:45
@likun666661
likun666661 merged commit cd2cb21 into apache:main Jul 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant