From 3d2734185b016e2eb5403a914492f103571c005a Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 3 Apr 2026 23:10:07 +0100 Subject: [PATCH] test: stabilize rebased auto-reply command checks --- src/auto-reply/reply/commands-allowlist.ts | 6 +----- src/auto-reply/reply/commands.test.ts | 24 +++++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/auto-reply/reply/commands-allowlist.ts b/src/auto-reply/reply/commands-allowlist.ts index f22aed859c5..0c6a4296ab2 100644 --- a/src/auto-reply/reply/commands-allowlist.ts +++ b/src/auto-reply/reply/commands-allowlist.ts @@ -12,11 +12,7 @@ import { readChannelAllowFromStore, removeChannelAllowFromStoreEntry, } from "../../pairing/pairing-store.js"; -import { - DEFAULT_ACCOUNT_ID, - normalizeAccountId, - normalizeOptionalAccountId, -} from "../../routing/session-key.js"; +import { DEFAULT_ACCOUNT_ID, normalizeOptionalAccountId } from "../../routing/session-key.js"; import { normalizeStringEntries } from "../../shared/string-normalization.js"; import { rejectNonOwnerCommand, diff --git a/src/auto-reply/reply/commands.test.ts b/src/auto-reply/reply/commands.test.ts index 104b4f5dcdb..9dcf6d4d2ea 100644 --- a/src/auto-reply/reply/commands.test.ts +++ b/src/auto-reply/reply/commands.test.ts @@ -949,9 +949,9 @@ describe("/approve command", () => { ...telegramCommandTestPlugin, config: { ...telegramCommandTestPlugin.config, - defaultAccountId: (cfg) => - ((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ?? - DEFAULT_ACCOUNT_ID), + defaultAccountId: (cfg: OpenClawConfig) => + (cfg.channels?.telegram as { defaultAccount?: string } | undefined) + ?.defaultAccount ?? DEFAULT_ACCOUNT_ID, }, }, source: "test", @@ -1839,9 +1839,9 @@ describe("handleCommands /config configWrites gating", () => { ...telegramCommandTestPlugin, config: { ...telegramCommandTestPlugin.config, - defaultAccountId: (cfg) => - ((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ?? - DEFAULT_ACCOUNT_ID), + defaultAccountId: (cfg: OpenClawConfig) => + (cfg.channels?.telegram as { defaultAccount?: string } | undefined) + ?.defaultAccount ?? DEFAULT_ACCOUNT_ID, }, }, }, @@ -2179,9 +2179,9 @@ describe("handleCommands /allowlist", () => { ...telegramCommandTestPlugin, config: { ...telegramCommandTestPlugin.config, - defaultAccountId: (cfg) => - ((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ?? - DEFAULT_ACCOUNT_ID), + defaultAccountId: (cfg: OpenClawConfig) => + (cfg.channels?.telegram as { defaultAccount?: string } | undefined) + ?.defaultAccount ?? DEFAULT_ACCOUNT_ID, }, }, }, @@ -2251,9 +2251,9 @@ describe("handleCommands /allowlist", () => { ...telegramCommandTestPlugin, config: { ...telegramCommandTestPlugin.config, - defaultAccountId: (cfg) => - ((cfg.channels?.telegram as { defaultAccount?: string } | undefined)?.defaultAccount ?? - DEFAULT_ACCOUNT_ID), + defaultAccountId: (cfg: OpenClawConfig) => + (cfg.channels?.telegram as { defaultAccount?: string } | undefined) + ?.defaultAccount ?? DEFAULT_ACCOUNT_ID, }, }, },