mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-16 18:34:18 +00:00
test: drop stale session store mocks
This commit is contained in:
@@ -141,7 +141,6 @@ vi.mock("./runtime-api.js", async () => {
|
||||
function createRuntimeCore(cfg: OpenClawConfig) {
|
||||
const runPrepared = vi.fn(
|
||||
async (turn: {
|
||||
storePath: string;
|
||||
routeSessionKey: string;
|
||||
ctxPayload: { SessionKey?: string };
|
||||
recordInboundSession: (params: unknown) => Promise<void>;
|
||||
@@ -157,7 +156,6 @@ function createRuntimeCore(cfg: OpenClawConfig) {
|
||||
}>;
|
||||
}) => {
|
||||
await turn.recordInboundSession({
|
||||
storePath: turn.storePath,
|
||||
sessionKey: turn.ctxPayload.SessionKey ?? turn.routeSessionKey,
|
||||
ctx: turn.ctxPayload,
|
||||
groupResolution: turn.record?.groupResolution,
|
||||
|
||||
@@ -52,8 +52,6 @@ const createChannelMessageReplyPipeline = vi.hoisted(() =>
|
||||
})),
|
||||
);
|
||||
const wasSentByBot = vi.hoisted(() => vi.fn(() => false));
|
||||
const loadSessionStore = vi.hoisted(() => vi.fn());
|
||||
const resolveStorePath = vi.hoisted(() => vi.fn(() => "/tmp/sessions.json"));
|
||||
const sessionRows = vi.hoisted(() => ({ value: {} as Record<string, Record<string, unknown>> }));
|
||||
const getSessionEntry = vi.hoisted(() =>
|
||||
vi.fn(({ sessionKey }: { sessionKey: string }) => sessionRows.value[sessionKey]),
|
||||
@@ -109,7 +107,6 @@ vi.mock("./send.js", () => ({
|
||||
vi.mock("./bot-message-dispatch.runtime.js", () => ({
|
||||
generateTopicLabel,
|
||||
getAgentScopedMediaLocalRoots,
|
||||
loadSessionStore,
|
||||
getSessionEntry,
|
||||
resolveAutoTopicLabelConfig: resolveAutoTopicLabelConfigRuntime,
|
||||
resolveChunkMode,
|
||||
@@ -195,8 +192,6 @@ describe("dispatchTelegramMessage draft streaming", () => {
|
||||
listSkillCommandsForAgents.mockReset();
|
||||
createChannelMessageReplyPipeline.mockReset();
|
||||
wasSentByBot.mockReset();
|
||||
loadSessionStore.mockReset();
|
||||
resolveStorePath.mockReset();
|
||||
sessionRows.value = {};
|
||||
getSessionEntry.mockReset();
|
||||
getSessionEntry.mockImplementation(
|
||||
@@ -250,8 +245,6 @@ describe("dispatchTelegramMessage draft streaming", () => {
|
||||
onModelSelected: () => undefined,
|
||||
});
|
||||
wasSentByBot.mockReturnValue(false);
|
||||
resolveStorePath.mockReturnValue("/tmp/sessions.json");
|
||||
loadSessionStore.mockReturnValue({});
|
||||
sessionRows.value = {};
|
||||
generateTopicLabel.mockResolvedValue("Topic label");
|
||||
describeStickerImage.mockResolvedValue(null);
|
||||
@@ -341,7 +334,6 @@ describe("dispatchTelegramMessage draft streaming", () => {
|
||||
removeAckAfterReply: false,
|
||||
} as unknown as TelegramMessageContext;
|
||||
base.turn = {
|
||||
storePath: "/tmp/openclaw/telegram-agent.sqlite",
|
||||
recordInboundSession: vi.fn(async () => undefined),
|
||||
record: {
|
||||
onRecordError: vi.fn(),
|
||||
|
||||
@@ -126,7 +126,6 @@ vi.mock("./runtime-api.js", async (importOriginal) => {
|
||||
recordSessionMetaFromInbound: async () => {},
|
||||
resolveChannelContextVisibilityMode: () => "off",
|
||||
resolveInboundSessionEnvelopeContext: () => ({
|
||||
storePath: "/tmp",
|
||||
envelopeOptions: {},
|
||||
previousTimestamp: undefined,
|
||||
}),
|
||||
|
||||
@@ -222,7 +222,6 @@ describe("getReplyFromConfig fast test bootstrap", () => {
|
||||
workspace: path.join(home, "workspace"),
|
||||
},
|
||||
},
|
||||
session: { store: path.join(home, "sessions.json") },
|
||||
} as OpenClawConfig);
|
||||
|
||||
const reply = await getReplyFromConfig(
|
||||
@@ -257,7 +256,6 @@ describe("getReplyFromConfig fast test bootstrap", () => {
|
||||
workspace: path.join(home, "workspace"),
|
||||
},
|
||||
},
|
||||
session: { store: path.join(home, "sessions.json") },
|
||||
} as OpenClawConfig);
|
||||
mocks.resolveReplyDirectives.mockResolvedValueOnce({
|
||||
kind: "reply",
|
||||
|
||||
Reference in New Issue
Block a user