test: use sqlite locators in command session fixtures

This commit is contained in:
Peter Steinberger
2026-05-09 06:16:32 +01:00
parent 163e693510
commit 746a0998d0
5 changed files with 12 additions and 12 deletions

View File

@@ -308,7 +308,7 @@ describe("runReplyAgent auto-compaction token update", () => {
sessionId: "session",
sessionKey: "main",
messageProvider: "whatsapp",
sessionFile: params.sessionFile ?? "/tmp/session.jsonl",
sessionFile: params.sessionFile ?? createTestTranscriptLocator(),
workspaceDir: params.workspaceDir ?? "/tmp",
config: params.config ?? {},
skillsSnapshot: {},

View File

@@ -116,7 +116,7 @@ describe("emitResetCommandHooks", () => {
sessionKey: "agent:main:telegram:group:-1003826723328:topic:8428",
previousSessionEntry: {
sessionId: "prev-session",
sessionFile: "/tmp/prev-session.jsonl",
sessionFile: "sqlite-transcript://main/prev-session.jsonl",
} as HandleCommandsParams["previousSessionEntry"],
workspaceDir: "/tmp/openclaw-workspace",
});
@@ -124,7 +124,7 @@ describe("emitResetCommandHooks", () => {
await vi.waitFor(() => expect(hookRunnerMocks.runBeforeReset).toHaveBeenCalledTimes(1));
expect(hookRunnerMocks.runBeforeReset).toHaveBeenCalledWith(
expect.objectContaining({
sessionFile: "/tmp/prev-session.jsonl",
sessionFile: "sqlite-transcript://main/prev-session.jsonl",
messages: [],
reason: "new",
}),
@@ -164,7 +164,7 @@ describe("emitResetCommandHooks", () => {
sessionKey: "agent:target:main",
previousSessionEntry: {
sessionId: "prev-session",
sessionFile: "/tmp/prev-session.jsonl",
sessionFile: "sqlite-transcript://main/prev-session.jsonl",
} as HandleCommandsParams["previousSessionEntry"],
workspaceDir: "/tmp/openclaw-workspace",
});
@@ -180,7 +180,7 @@ describe("emitResetCommandHooks", () => {
});
expect(hookRunnerMocks.runBeforeReset).toHaveBeenCalledWith(
expect.objectContaining({
sessionFile: "/tmp/prev-session.jsonl",
sessionFile: "sqlite-transcript://main/prev-session.jsonl",
messages: [{ role: "assistant", content: "Recovered from SQLite" }],
reason: "reset",
}),

View File

@@ -86,13 +86,13 @@ describe("handlePluginCommand", () => {
} as OpenClawConfig);
params.sessionEntry = {
sessionId: "wrapper-session",
sessionFile: "/tmp/wrapper-session.jsonl",
sessionFile: "sqlite-transcript://main/wrapper-session.jsonl",
updatedAt: Date.now(),
} as HandleCommandsParams["sessionEntry"];
params.sessionStore = {
[params.sessionKey]: {
sessionId: "target-session",
sessionFile: "/tmp/target-session.jsonl",
sessionFile: "sqlite-transcript://main/target-session.jsonl",
updatedAt: Date.now(),
},
};
@@ -102,7 +102,7 @@ describe("handlePluginCommand", () => {
expect(executePluginCommandMock).toHaveBeenCalledWith(
expect.objectContaining({
sessionId: "target-session",
sessionFile: "/tmp/target-session.jsonl",
sessionFile: "sqlite-transcript://main/target-session.jsonl",
}),
);
});

View File

@@ -142,13 +142,13 @@ describe("handleUsageCommand", () => {
const params = buildUsageParams();
params.sessionEntry = {
sessionId: "wrapper-session",
sessionFile: "/tmp/wrapper-session.jsonl",
sessionFile: "sqlite-transcript://target/wrapper-session.jsonl",
updatedAt: Date.now(),
};
params.sessionStore = {
[params.sessionKey]: {
sessionId: "target-session",
sessionFile: "/tmp/target-session.jsonl",
sessionFile: "sqlite-transcript://target/target-session.jsonl",
updatedAt: Date.now(),
},
};
@@ -158,7 +158,7 @@ describe("handleUsageCommand", () => {
expect(loadSessionCostSummaryMock).toHaveBeenCalledWith(
expect.objectContaining({
sessionId: "target-session",
sessionFile: "/tmp/target-session.jsonl",
sessionFile: "sqlite-transcript://target/target-session.jsonl",
}),
);
});

View File

@@ -14,7 +14,7 @@ function makeRun(): FollowupRun["run"] {
agentDir: "/tmp/agent",
sessionId: "session-1",
sessionKey: QUEUE_KEY,
sessionFile: "/tmp/session-1.jsonl",
sessionFile: "sqlite-transcript://main/session-1.jsonl",
workspaceDir: "/tmp/workspace",
config: {} as FollowupRun["run"]["config"],
provider: "anthropic",