mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(doctor): skip legacy main transcript check for SQLite-owned sessions (#119940)
* fix(doctor): skip legacy main transcript check for SQLite-owned sessions After the SQLite session import, the main session's legacy .jsonl is archived and 'sessions cleanup' prunes it as unreferenced, but doctor still warned 'Main session transcript missing' because the main-session check required the legacy file. The sibling recent-session check already skips SQLite-owned keys; apply the same ownership guard to the main session so doctor and cleanup agree. (#119926) * style(doctor): condense SQLite ownership comment Co-authored-by: 李琪0668001400 <li.qi16@xydigit.com> --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
@@ -617,6 +617,10 @@ describe("doctor state integrity oauth dir checks", () => {
|
||||
const cfg: OpenClawConfig = {};
|
||||
setupSessionState(cfg, process.env, process.env.HOME ?? "");
|
||||
const storePath = resolveStorePath(cfg.session?.store, { agentId: "main" });
|
||||
await upsertSessionEntry(
|
||||
{ agentId: "main", sessionKey: "agent:main:main", storePath },
|
||||
{ sessionId: "sqlite-main-session", updatedAt: Date.now() },
|
||||
);
|
||||
await upsertSessionEntry(
|
||||
{ agentId: "main", sessionKey: "agent:main:sqlite-only", storePath },
|
||||
{ sessionId: "sqlite-only-session", updatedAt: Date.now() },
|
||||
@@ -628,6 +632,7 @@ describe("doctor state integrity oauth dir checks", () => {
|
||||
});
|
||||
|
||||
expect(stateIntegrityText()).not.toContain("recent sessions are missing transcripts");
|
||||
expect(stateIntegrityText()).not.toContain("Main session transcript missing");
|
||||
});
|
||||
|
||||
it("does not auto-archive orphan transcripts from non-interactive repair mode", async () => {
|
||||
|
||||
@@ -1474,7 +1474,9 @@ export async function noteStateIntegrity(
|
||||
|
||||
const mainKey = resolveMainSessionKey(cfg);
|
||||
const mainEntry = store[mainKey];
|
||||
if (mainEntry?.sessionId) {
|
||||
// SQLite-owned transcripts live in the agent DB after import.
|
||||
// Do not require the archived legacy JSONL for those sessions.
|
||||
if (mainEntry?.sessionId && !sqliteSessionKeys.has(mainKey)) {
|
||||
const transcriptPath = resolveSessionFilePath(
|
||||
mainEntry.sessionId,
|
||||
mainEntry,
|
||||
|
||||
Reference in New Issue
Block a user