Files
openclaw/test/scripts/sqlite-sessions-transcripts-flip-proof.e2e.test.ts
Peter SteinbergerandAmp df905a6cb6 fix(sessions): preserve shared history across startup and repairs (#127241)
* fix(doctor): atomically repair session transcripts

* fix(sessions): keep runtime reads and repairs on SQLite owners

Resolve physical session databases once and carry that identity through startup, search, boards, maintenance, and Doctor. Remove automatic legacy JSON import from Gateway startup while preserving explicit Doctor upgrades.

Publish repaired legacy transcripts with strict atomic replacement and preserve the source when backup, write, or rename fails.

* fix(sessions): simplify startup ownership and diagnostics

* test(sessions): migrate legacy history through Doctor in CLI proof

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-08-28 03:32:53 -07:00

16 lines
763 B
TypeScript

// SQLite sessions/transcripts flip proof test runs the script-style gateway lifecycle probe.
import { describe, it } from "vitest";
import { withEnvAsync } from "../../src/test-utils/env.js";
import { assertSqliteFlipProofCore } from "../helpers/sqlite-sessions-transcripts-flip-proof-assertions.ts";
import { runSqliteSessionsTranscriptsFlipProof } from "../helpers/sqlite-sessions-transcripts-flip-proof.ts";
describe("SQLite sessions/transcripts flip proof harness", () => {
it("proves isolated gateway lifecycle state stays SQLite-first", async () => {
const report = await withEnvAsync({ ZAI_API_KEY: "ambient-provider-fixture" }, () =>
runSqliteSessionsTranscriptsFlipProof(),
);
assertSqliteFlipProofCore(report);
}, 420_000);
});