
























@@ -9,6 +9,7 @@ import {
99type OpenClawConfig,
1010} from "openclaw/plugin-sdk/runtime-config-snapshot";
1111import { beforeEach, describe, expect, it, vi } from "vitest";
12+import { EMPTY_DISCORD_TEST_CONFIG } from "../test-support/config.js";
12131314const hoisted = vi.hoisted(() => {
1415const sendMessageDiscord = vi.fn(async (_to: string, _text: string, _opts?: unknown) => ({}));
@@ -76,7 +77,7 @@ function createTestThreadBindingManager(
7677},
7778) {
7879return createThreadBindingManager({
79-cfg: {} as OpenClawConfig,
80+cfg: EMPTY_DISCORD_TEST_CONFIG,
8081 ...params,
8182});
8283}
@@ -270,7 +271,7 @@ describe("thread binding lifecycle", () => {
270271try {
271272const manager = createTestThreadBindingManager({
272273accountId: "default",
273-cfg: {} as OpenClawConfig,
274+cfg: EMPTY_DISCORD_TEST_CONFIG,
274275persist: false,
275276enableSweeper: false,
276277idleTimeoutMs: 60_000,
@@ -310,7 +311,7 @@ describe("thread binding lifecycle", () => {
310311try {
311312const manager = createTestThreadBindingManager({
312313accountId: "default",
313-cfg: {} as OpenClawConfig,
314+cfg: EMPTY_DISCORD_TEST_CONFIG,
314315persist: false,
315316enableSweeper: false,
316317idleTimeoutMs: 0,
@@ -786,7 +787,7 @@ describe("thread binding lifecycle", () => {
786787hoisted.createThreadDiscord.mockResolvedValueOnce({ id: "thread-created-2" });
787788788789const childBinding = await autoBindSpawnedDiscordSubagent({
789-cfg: {} as OpenClawConfig,
790+cfg: EMPTY_DISCORD_TEST_CONFIG,
790791accountId: "default",
791792channel: "discord",
792793to: "channel:thread-1",
@@ -827,7 +828,7 @@ describe("thread binding lifecycle", () => {
827828hoisted.createThreadDiscord.mockResolvedValueOnce({ id: "thread-created-lookup" });
828829829830const childBinding = await autoBindSpawnedDiscordSubagent({
830-cfg: {} as OpenClawConfig,
831+cfg: EMPTY_DISCORD_TEST_CONFIG,
831832accountId: "default",
832833channel: "discord",
833834to: "channel:thread-lookup",
@@ -1314,7 +1315,7 @@ describe("thread binding lifecycle", () => {
13141315});
1315131613161317const result = await reconcileAcpThreadBindingsOnStartup({
1317-cfg: {} as OpenClawConfig,
1318+cfg: EMPTY_DISCORD_TEST_CONFIG,
13181319accountId: "default",
13191320});
13201321@@ -1358,15 +1359,15 @@ describe("thread binding lifecycle", () => {
13581359hoisted.readAcpSessionEntry.mockReturnValue({
13591360sessionKey: "agent:codex:acp:uncertain",
13601361storeSessionKey: "agent:codex:acp:uncertain",
1361-cfg: {} as OpenClawConfig,
1362+cfg: EMPTY_DISCORD_TEST_CONFIG,
13621363storePath: "/tmp/mock-sessions.json",
13631364storeReadFailed: true,
13641365entry: undefined,
13651366acp: undefined,
13661367});
1367136813681369const result = await reconcileAcpThreadBindingsOnStartup({
1369-cfg: {} as OpenClawConfig,
1370+cfg: EMPTY_DISCORD_TEST_CONFIG,
13701371accountId: "default",
13711372});
13721373@@ -1405,7 +1406,7 @@ describe("thread binding lifecycle", () => {
14051406hoisted.readAcpSessionEntry.mockReturnValue(null);
1406140714071408const result = await reconcileAcpThreadBindingsOnStartup({
1408-cfg: {} as OpenClawConfig,
1409+cfg: EMPTY_DISCORD_TEST_CONFIG,
14091410accountId: "default",
14101411});
14111412@@ -1454,7 +1455,7 @@ describe("thread binding lifecycle", () => {
14541455});
1455145614561457const result = await reconcileAcpThreadBindingsOnStartup({
1457-cfg: {} as OpenClawConfig,
1458+cfg: EMPTY_DISCORD_TEST_CONFIG,
14581459accountId: "default",
14591460healthProbe: async () => ({ status: "stale", reason: "status-timeout-running-stale" }),
14601461});
@@ -1498,7 +1499,7 @@ describe("thread binding lifecycle", () => {
14981499});
1499150015001501const result = await reconcileAcpThreadBindingsOnStartup({
1501-cfg: {} as OpenClawConfig,
1502+cfg: EMPTY_DISCORD_TEST_CONFIG,
15021503accountId: "default",
15031504healthProbe: async () => ({ status: "uncertain", reason: "status-timeout" }),
15041505});
@@ -1546,7 +1547,7 @@ describe("thread binding lifecycle", () => {
15461547});
1547154815481549const result = await reconcileAcpThreadBindingsOnStartup({
1549-cfg: {} as OpenClawConfig,
1550+cfg: EMPTY_DISCORD_TEST_CONFIG,
15501551accountId: "default",
15511552});
15521553@@ -1612,7 +1613,7 @@ describe("thread binding lifecycle", () => {
16121613let secondProbeStartedBeforeFirstResolved = false;
1613161416141615const reconcilePromise = reconcileAcpThreadBindingsOnStartup({
1615-cfg: {} as OpenClawConfig,
1616+cfg: EMPTY_DISCORD_TEST_CONFIG,
16161617accountId: "default",
16171618healthProbe: async () => {
16181619probeCallCount += 1;
@@ -1684,7 +1685,7 @@ describe("thread binding lifecycle", () => {
16841685});
1685168616861687const reconcilePromise = reconcileAcpThreadBindingsOnStartup({
1687-cfg: {} as OpenClawConfig,
1688+cfg: EMPTY_DISCORD_TEST_CONFIG,
16881689accountId: "default",
16891690healthProbe: async () => {
16901691probeCalls += 1;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。