mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 09:39:25 +00:00
* 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>
25 lines
1.2 KiB
TypeScript
25 lines
1.2 KiB
TypeScript
// Built-CLI SQLite flip proof requires dist entrypoints before running the gateway lifecycle.
|
|
import path from "node:path";
|
|
import { describe, expect, 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 built CLI proof", () => {
|
|
it("proves the lifecycle through the built gateway CLI entrypoint", async () => {
|
|
const report = await withEnvAsync({ ZAI_API_KEY: "ambient-provider-fixture" }, () =>
|
|
runSqliteSessionsTranscriptsFlipProof({ requireBuiltCli: true }),
|
|
);
|
|
|
|
expect(report.gatewayEntrypoint).toEqual(
|
|
expect.arrayContaining([expect.stringMatching(/^dist\/index\.(?:js|mjs)$/u)]),
|
|
);
|
|
assertSqliteFlipProofCore(report);
|
|
// Source checkouts also discover source-only plugins. Verify the packaged
|
|
// provider this proof actually exercises without excluding those plugins.
|
|
expect(report.bundledPlugins).toContainEqual({
|
|
id: "openai",
|
|
source: path.resolve("dist", "extensions", "openai", "index.js"),
|
|
});
|
|
}, 420_000);
|
|
});
|