


























@@ -31,7 +31,7 @@ const channelPluginMocks = vi.hoisted(() => ({
3131| ((params: { kind: "tool" | "block" | "final"; text?: string }) => boolean)
3232| undefined,
3333getChannelPlugin: vi.fn((channelId: string) => {
34-if (channelId !== "discord" && channelId !== "telegram") {
34+if (channelId !== "visiblechat") {
3535return undefined;
3636}
3737return {
@@ -76,8 +76,8 @@ function createCoordinator(onReplyStart?: (...args: unknown[]) => Promise<void>)
7676return createAcpDispatchDeliveryCoordinator({
7777cfg: createAcpTestConfig(),
7878ctx: buildTestCtx({
79-Provider: "discord",
80-Surface: "discord",
79+Provider: "visiblechat",
80+Surface: "visiblechat",
8181SessionKey: "agent:codex-acp:session-1",
8282}),
8383dispatcher: createDispatcher(),
@@ -87,33 +87,33 @@ function createCoordinator(onReplyStart?: (...args: unknown[]) => Promise<void>)
8787});
8888}
898990-function createDiscordAcpCoordinator(cfg: OpenClawConfig) {
90+function createVisibleChatAcpCoordinator(cfg: OpenClawConfig) {
9191return createAcpDispatchDeliveryCoordinator({
9292 cfg,
9393ctx: buildTestCtx({
94-Provider: "discord",
95-Surface: "discord",
94+Provider: "visiblechat",
95+Surface: "visiblechat",
9696SessionKey: "agent:codex-acp:session-1",
9797}),
9898dispatcher: createDispatcher(),
9999inboundAudio: false,
100100shouldRouteToOriginating: true,
101-originatingChannel: "discord",
101+originatingChannel: "visiblechat",
102102originatingTo: "channel:thread-1",
103103});
104104}
105105106-async function expectDiscordBlockRoutesToAccount(
106+async function expectVisibleChatBlockRoutesToAccount(
107107cfg: OpenClawConfig,
108108accountId: string | undefined,
109109): Promise<void> {
110-const coordinator = createDiscordAcpCoordinator(cfg);
110+const coordinator = createVisibleChatAcpCoordinator(cfg);
111111112112await coordinator.deliver("block", { text: "hello" }, { skipTts: true });
113113114114expect(deliveryMocks.routeReply).toHaveBeenCalledWith(
115115expect.objectContaining({
116-channel: "discord",
116+channel: "visiblechat",
117117to: "channel:thread-1",
118118 accountId,
119119}),
@@ -142,8 +142,8 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
142142const coordinator = createAcpDispatchDeliveryCoordinator({
143143cfg: createAcpTestConfig(),
144144ctx: buildTestCtx({
145-Provider: "discord",
146-Surface: "discord",
145+Provider: "visiblechat",
146+Surface: "visiblechat",
147147SessionKey: "agent:codex-acp:session-1",
148148}),
149149 dispatcher,
@@ -178,8 +178,8 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
178178const coordinator = createAcpDispatchDeliveryCoordinator({
179179cfg: createAcpTestConfig(),
180180ctx: buildTestCtx({
181-Provider: "telegram",
182-Surface: "telegram",
181+Provider: "visiblechat",
182+Surface: "visiblechat",
183183SessionKey: "agent:codex-acp:session-1",
184184}),
185185dispatcher: createDispatcher(),
@@ -196,11 +196,11 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
196196expect(coordinator.getRoutedCounts().block).toBe(0);
197197});
198198199-it("prefers provider over surface when detecting direct telegram visibility", async () => {
199+it("prefers provider over surface when detecting direct channel visibility", async () => {
200200const coordinator = createAcpDispatchDeliveryCoordinator({
201201cfg: createAcpTestConfig(),
202202ctx: buildTestCtx({
203-Provider: "telegram",
203+Provider: "visiblechat",
204204Surface: "webchat",
205205SessionKey: "agent:codex-acp:session-1",
206206}),
@@ -220,8 +220,8 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
220220const coordinator = createAcpDispatchDeliveryCoordinator({
221221cfg: createAcpTestConfig(),
222222ctx: buildTestCtx({
223-Provider: "whatsapp",
224-Surface: "whatsapp",
223+Provider: "plainchat",
224+Surface: "plainchat",
225225SessionKey: "agent:codex-acp:session-1",
226226}),
227227dispatcher: createDispatcher(),
@@ -238,7 +238,7 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
238238expect(coordinator.getRoutedCounts().block).toBe(0);
239239});
240240241-it("treats direct discord block text as visible", async () => {
241+it("treats direct plugin-owned block text as visible", async () => {
242242const coordinator = createCoordinator();
243243244244await coordinator.deliver("block", { text: "hello" }, { skipTts: true });
@@ -266,7 +266,7 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
266266expect(coordinator.hasFailedVisibleTextDelivery()).toBe(false);
267267});
268268269-it("tracks failed visible telegram block delivery separately", async () => {
269+it("tracks failed visible block delivery separately", async () => {
270270const dispatcher: ReplyDispatcher = {
271271sendToolResult: vi.fn(() => true),
272272sendBlockReply: vi.fn(() => false),
@@ -279,8 +279,8 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
279279const coordinator = createAcpDispatchDeliveryCoordinator({
280280cfg: createAcpTestConfig(),
281281ctx: buildTestCtx({
282-Provider: "telegram",
283-Surface: "telegram",
282+Provider: "visiblechat",
283+Surface: "visiblechat",
284284SessionKey: "agent:codex-acp:session-1",
285285}),
286286 dispatcher,
@@ -351,8 +351,8 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
351351const coordinator = createAcpDispatchDeliveryCoordinator({
352352cfg: createAcpTestConfig(),
353353ctx: buildTestCtx({
354-Provider: "discord",
355-Surface: "discord",
354+Provider: "visiblechat",
355+Surface: "visiblechat",
356356SessionKey: "agent:codex-acp:session-1",
357357}),
358358 dispatcher,
@@ -377,16 +377,16 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
377377const coordinator = createAcpDispatchDeliveryCoordinator({
378378cfg: createAcpTestConfig(),
379379ctx: buildTestCtx({
380-Provider: "telegram",
381-Surface: "telegram",
380+Provider: "visiblechat",
381+Surface: "visiblechat",
382382SessionKey: "agent:codex-acp:session-1",
383383}),
384384 dispatcher,
385385inboundAudio: false,
386386suppressUserDelivery: true,
387387shouldRouteToOriginating: true,
388-originatingChannel: "telegram",
389-originatingTo: "telegram:123",
388+originatingChannel: "visiblechat",
389+originatingTo: "visiblechat:123",
390390});
391391392392const blockDelivered = await coordinator.deliver("block", { text: "working on it" });
@@ -402,10 +402,10 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
402402});
403403404404it("routes ACP replies through the configured default account when AccountId is omitted", async () => {
405-await expectDiscordBlockRoutesToAccount(
405+await expectVisibleChatBlockRoutesToAccount(
406406createAcpTestConfig({
407407channels: {
408-discord: {
408+visiblechat: {
409409defaultAccount: "work",
410410},
411411},
@@ -415,21 +415,21 @@ describe("createAcpDispatchDeliveryCoordinator", () => {
415415});
416416417417it("routes ACP replies when cfg.channels is missing", async () => {
418-await expectDiscordBlockRoutesToAccount({} as OpenClawConfig, undefined);
418+await expectVisibleChatBlockRoutesToAccount({} as OpenClawConfig, undefined);
419419});
420420421-it("treats routed discord block text as visible", async () => {
421+it("treats routed plugin-owned block text as visible", async () => {
422422const coordinator = createAcpDispatchDeliveryCoordinator({
423423cfg: createAcpTestConfig(),
424424ctx: buildTestCtx({
425-Provider: "discord",
426-Surface: "discord",
425+Provider: "visiblechat",
426+Surface: "visiblechat",
427427SessionKey: "agent:codex-acp:session-1",
428428}),
429429dispatcher: createDispatcher(),
430430inboundAudio: false,
431431shouldRouteToOriginating: true,
432-originatingChannel: "discord",
432+originatingChannel: "visiblechat",
433433originatingTo: "channel:thread-1",
434434});
435435此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。