mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-21 21:56:46 +00:00
test: use sqlite locators in command session fixtures
This commit is contained in:
@@ -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: {},
|
||||
|
||||
@@ -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",
|
||||
}),
|
||||
|
||||
@@ -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",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -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",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user