|
1 | 1 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
| 2 | +import { discordPlugin } from "../../../extensions/discord/src/channel.js"; |
2 | 3 | import { AcpRuntimeError } from "../../acp/runtime/errors.js"; |
3 | 4 | import type { OpenClawConfig } from "../../config/config.js"; |
4 | 5 | import type { SessionBindingRecord } from "../../infra/outbound/session-binding-service.js"; |
5 | 6 | import type { PluginTargetedInboundClaimOutcome } from "../../plugins/hooks.js"; |
| 7 | +import { setActivePluginRegistry } from "../../plugins/runtime.js"; |
| 8 | +import { createTestRegistry } from "../../test-utils/channel-plugins.js"; |
6 | 9 | import { createInternalHookEventPayload } from "../../test-utils/internal-hook-event-payload.js"; |
7 | 10 | import type { MsgContext } from "../templating.js"; |
8 | 11 | import type { GetReplyOptions, ReplyPayload } from "../types.js"; |
@@ -252,6 +255,9 @@ async function dispatchTwiceWithFreshDispatchers(params: Omit<DispatchReplyArgs, |
252 | 255 |
|
253 | 256 | describe("dispatchReplyFromConfig", () => { |
254 | 257 | beforeEach(() => { |
| 258 | + setActivePluginRegistry( |
| 259 | + createTestRegistry([{ pluginId: "discord", source: "test", plugin: discordPlugin }]), |
| 260 | + ); |
255 | 261 | acpManagerTesting.resetAcpSessionManagerForTests(); |
256 | 262 | resetInboundDedupe(); |
257 | 263 | mocks.routeReply.mockReset(); |
@@ -1295,6 +1301,11 @@ describe("dispatchReplyFromConfig", () => { |
1295 | 1301 | commands: { |
1296 | 1302 | text: false, |
1297 | 1303 | }, |
| 1304 | + session: { |
| 1305 | + sendPolicy: { |
| 1306 | + default: "allow", |
| 1307 | + }, |
| 1308 | + }, |
1298 | 1309 | } as OpenClawConfig; |
1299 | 1310 | const dispatcher = createDispatcher(); |
1300 | 1311 | const ctx = buildTestCtx({ |
|
0 commit comments