Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4
gumadeiras
·
2026-04-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -16,15 +16,9 @@ const mocks = vi.hoisted(() => ({
|
16 | 16 | deliverOutboundPayloads: vi.fn(), |
17 | 17 | })); |
18 | 18 | |
19 | | -vi.mock("../../infra/outbound/deliver-runtime.js", async () => { |
20 | | -const actual = await vi.importActual<typeof import("../../infra/outbound/deliver-runtime.js")>( |
21 | | -"../../infra/outbound/deliver-runtime.js", |
22 | | -); |
23 | | -return { |
24 | | - ...actual, |
25 | | -deliverOutboundPayloads: mocks.deliverOutboundPayloads, |
26 | | -}; |
27 | | -}); |
| 19 | +vi.mock("../../infra/outbound/deliver-runtime.js", () => ({ |
| 20 | +deliverOutboundPayloads: mocks.deliverOutboundPayloads, |
| 21 | +})); |
28 | 22 | |
29 | 23 | const { routeReply } = await import("./route-reply.js"); |
30 | 24 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -93,10 +93,11 @@ export async function routeReply(params: RouteReplyParams): Promise<RouteReplyRe
|
93 | 93 | const normalizedChannel = normalizeMessageChannel(channel); |
94 | 94 | const channelId = |
95 | 95 | normalizeChannelId(channel) ?? normalizeOptionalLowercaseString(channel) ?? null; |
96 | | -const loadedPlugin = channelId ? getLoadedChannelPlugin(channelId) : undefined; |
97 | | -const bundledPlugin = channelId ? getBundledChannelPlugin(channelId) : undefined; |
98 | | -const messaging = loadedPlugin?.messaging ?? bundledPlugin?.messaging; |
99 | | -const threading = loadedPlugin?.threading ?? bundledPlugin?.threading; |
| 96 | +const plugin = channelId |
| 97 | + ? (getLoadedChannelPlugin(channelId) ?? getBundledChannelPlugin(channelId)) |
| 98 | + : undefined; |
| 99 | +const messaging = plugin?.messaging; |
| 100 | +const threading = plugin?.threading; |
100 | 101 | const resolvedAgentId = params.sessionKey |
101 | 102 | ? resolveSessionAgentId({ |
102 | 103 | sessionKey: params.sessionKey, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。