fix(cron): bootstrap external channel delivery targets (#82371) · openclaw/openclaw@d7d85d1
giodl73-repo
·
2026-05-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -467,6 +467,7 @@ describe("resolveDeliveryTarget", () => {
|
467 | 467 | accountId: undefined, |
468 | 468 | mode: "explicit", |
469 | 469 | allowFrom: undefined, |
| 470 | +allowBootstrap: true, |
470 | 471 | }); |
471 | 472 | }); |
472 | 473 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -52,7 +52,7 @@ async function resolveOutboundTargetWithRuntime(
|
52 | 52 | return loaded; |
53 | 53 | } |
54 | 54 | const { resolveOutboundTarget } = await loadTargetsRuntime(); |
55 | | -return resolveOutboundTarget(params); |
| 55 | +return resolveOutboundTarget({ ...params, allowBootstrap: true }); |
56 | 56 | } catch (err) { |
57 | 57 | return { |
58 | 58 | ok: false as const, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -79,6 +79,27 @@ describe("resolveOutboundTarget defaultTo config fallback", () => {
|
79 | 79 | expect(res).toEqual({ ok: true, to: "default-room" }); |
80 | 80 | }); |
81 | 81 | |
| 82 | +it("passes bootstrap opt-in to channel plugin resolution", () => { |
| 83 | +const cfg: OpenClawConfig = { |
| 84 | +channels: { alpha: { defaultTo: "Alpha:Room One" } }, |
| 85 | +}; |
| 86 | + |
| 87 | +const res = resolveOutboundTarget({ |
| 88 | +channel: "alpha", |
| 89 | +to: "Alpha:Override Room", |
| 90 | + cfg, |
| 91 | +mode: "explicit", |
| 92 | +allowBootstrap: true, |
| 93 | +}); |
| 94 | + |
| 95 | +expect(res).toEqual({ ok: true, to: "override-room" }); |
| 96 | +expect(mocks.resolveOutboundChannelPlugin).toHaveBeenCalledWith({ |
| 97 | +channel: "alpha", |
| 98 | + cfg, |
| 99 | +allowBootstrap: true, |
| 100 | +}); |
| 101 | +}); |
| 102 | + |
82 | 103 | it("explicit --reply-to overrides defaultTo", () => { |
83 | 104 | const res = resolveOutboundTarget({ |
84 | 105 | channel: "alpha", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -56,6 +56,7 @@ export function resolveOutboundTarget(params: {
|
56 | 56 | channel: GatewayMessageChannel; |
57 | 57 | to?: string; |
58 | 58 | allowFrom?: string[]; |
| 59 | +allowBootstrap?: boolean; |
59 | 60 | cfg?: OpenClawConfig; |
60 | 61 | accountId?: string | null; |
61 | 62 | mode?: ChannelOutboundTargetMode; |
@@ -65,6 +66,7 @@ export function resolveOutboundTarget(params: {
|
65 | 66 | plugin: resolveOutboundChannelPlugin({ |
66 | 67 | channel: params.channel, |
67 | 68 | cfg: params.cfg, |
| 69 | +allowBootstrap: params.allowBootstrap, |
68 | 70 | }), |
69 | 71 | target: params, |
70 | 72 | onMissingPlugin: () => |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。