From 83a2926328b85b9ddd28f0f4ad5391b6ff910b26 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 22 Feb 2026 12:43:10 +0000 Subject: [PATCH] test: align remaining trigger configs with fast harness defaults --- ...ling.runs-compact-as-gated-command.test.ts | 19 ++----------- ...ng.runs-greeting-prompt-bare-reset.test.ts | 28 ++++++++----------- 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.test.ts b/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.test.ts index 6251192afce..115bf7e77ec 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.runs-compact-as-gated-command.test.ts @@ -37,6 +37,8 @@ describe("trigger handling", () => { it("runs /compact as a gated command", async () => { await withTempHome(async (home) => { const storePath = join(tmpdir(), `openclaw-session-test-${Date.now()}.json`); + const cfg = makeCfg(home); + cfg.session = { ...cfg.session, store: storePath }; mockSuccessfulCompaction(); const res = await getReplyFromConfig( @@ -47,22 +49,7 @@ describe("trigger handling", () => { CommandAuthorized: true, }, {}, - { - agents: { - defaults: { - model: { primary: "anthropic/claude-opus-4-5" }, - workspace: join(home, "openclaw"), - }, - }, - channels: { - whatsapp: { - allowFrom: ["*"], - }, - }, - session: { - store: storePath, - }, - }, + cfg, ); const text = replyText(res); expect(text?.startsWith("⚙️ Compacted")).toBe(true); diff --git a/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.test.ts b/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.test.ts index 47021c9540c..c9ec9d02975 100644 --- a/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.test.ts +++ b/src/auto-reply/reply.triggers.trigger-handling.runs-greeting-prompt-bare-reset.test.ts @@ -4,6 +4,7 @@ import { beforeAll, describe, expect, it } from "vitest"; import { getRunEmbeddedPiAgentMock, installTriggerHandlingE2eTestHooks, + makeCfg, runGreetingPromptForBareNewOrReset, withTempHome, } from "./reply.triggers.trigger-handling.test-harness.js"; @@ -21,6 +22,16 @@ async function expectResetBlockedForNonOwner(params: { getReplyFromConfig: typeof import("./reply.js").getReplyFromConfig; }): Promise { const { home, commandAuthorized, getReplyFromConfig } = params; + const cfg = makeCfg(home); + cfg.channels ??= {}; + cfg.channels.whatsapp = { + ...cfg.channels.whatsapp, + allowFrom: ["+1999"], + }; + cfg.session = { + ...cfg.session, + store: join(tmpdir(), `openclaw-session-test-${Date.now()}.json`), + }; const res = await getReplyFromConfig( { Body: "/reset", @@ -29,22 +40,7 @@ async function expectResetBlockedForNonOwner(params: { CommandAuthorized: commandAuthorized, }, {}, - { - agents: { - defaults: { - model: { primary: "anthropic/claude-opus-4-5" }, - workspace: join(home, "openclaw"), - }, - }, - channels: { - whatsapp: { - allowFrom: ["+1999"], - }, - }, - session: { - store: join(tmpdir(), `openclaw-session-test-${Date.now()}.json`), - }, - }, + cfg, ); expect(res).toBeUndefined(); expect(getRunEmbeddedPiAgentMock()).not.toHaveBeenCalled();