Skip to content

Commit 8711ada

Browse files
fix(clawsweeper): reconcile automerge-openclaw-openclaw-90198 with main (1)
1 parent fb8a0ae commit 8711ada

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

src/infra/outbound/channel-resolution.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,29 @@ describe("outbound channel resolution", () => {
342342
expect(resolveRuntimePluginRegistryMock).not.toHaveBeenCalled();
343343
});
344344

345+
it("resolves runtime outbound adapters that do not send text directly", async () => {
346+
const setupPlugin = { id: "alpha" };
347+
const runtimePlugin = { id: "alpha", outbound: { deliveryMode: "gateway" } };
348+
getLoadedChannelPluginMock.mockReturnValue(setupPlugin);
349+
getChannelPluginMock.mockReturnValue(undefined);
350+
getActivePluginRegistryMock.mockReturnValue({
351+
channels: [{ plugin: runtimePlugin }],
352+
});
353+
getActivePluginChannelRegistryMock.mockReturnValue({
354+
channels: [{ plugin: setupPlugin }],
355+
});
356+
const channelResolution = await importChannelResolution("runtime-outbound-adapter");
357+
358+
expect(
359+
channelResolution.resolveOutboundChannelPlugin({
360+
channel: "alpha",
361+
cfg: { channels: {} } as never,
362+
allowBootstrap: true,
363+
}),
364+
).toBe(runtimePlugin);
365+
expect(resolveRuntimePluginRegistryMock).not.toHaveBeenCalled();
366+
});
367+
345368
it("keeps setup shells visible for read-only channel lookup", async () => {
346369
const setupPlugin = { id: "alpha" };
347370
const runtimePlugin = { id: "alpha", outbound: { sendText: vi.fn() } };

src/infra/outbound/channel-resolution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function resolveSendCapableMessageAdapter(
141141
}
142142

143143
function channelPluginHasRuntimeOutboundSurface(plugin: ChannelPlugin | undefined): boolean {
144-
return Boolean(plugin?.outbound?.sendText ?? resolveSendCapableMessageAdapter(plugin));
144+
return Boolean(plugin?.outbound ?? resolveSendCapableMessageAdapter(plugin));
145145
}
146146

147147
function resolveRuntimeOutboundPlugin(plugin: ChannelPlugin): ChannelPlugin | undefined {

0 commit comments

Comments
 (0)