fix(doctor): preserve built-in channel plugin allow entries · openclaw/openclaw@75dd28e
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -114,6 +114,39 @@ describe("doctor stale plugin config helpers", () => {
|
114 | 114 | ]); |
115 | 115 | }); |
116 | 116 | |
| 117 | +it("keeps built-in channel ids in restrictive plugin config", () => { |
| 118 | +const result = maybeRepairStalePluginConfig({ |
| 119 | +plugins: { |
| 120 | +allow: ["telegram", "whatsapp", "acpx"], |
| 121 | +entries: { |
| 122 | +telegram: { enabled: true }, |
| 123 | +whatsapp: { enabled: true }, |
| 124 | +acpx: { enabled: true }, |
| 125 | +}, |
| 126 | +}, |
| 127 | +channels: { |
| 128 | +whatsapp: { |
| 129 | +enabled: true, |
| 130 | +allowFrom: ["+15555550123"], |
| 131 | +}, |
| 132 | +}, |
| 133 | +} as OpenClawConfig); |
| 134 | + |
| 135 | +expect(result.changes).toEqual([ |
| 136 | +"- plugins.allow: removed 1 stale plugin id (acpx)", |
| 137 | +"- plugins.entries: removed 1 stale plugin entry (acpx)", |
| 138 | +]); |
| 139 | +expect(result.config.plugins?.allow).toEqual(["telegram", "whatsapp"]); |
| 140 | +expect(result.config.plugins?.entries).toEqual({ |
| 141 | +telegram: { enabled: true }, |
| 142 | +whatsapp: { enabled: true }, |
| 143 | +}); |
| 144 | +expect(result.config.channels?.whatsapp).toEqual({ |
| 145 | +enabled: true, |
| 146 | +allowFrom: ["+15555550123"], |
| 147 | +}); |
| 148 | +}); |
| 149 | + |
117 | 150 | it("removes stale third-party channel config and dependent channel refs", () => { |
118 | 151 | const result = maybeRepairStalePluginConfig({ |
119 | 152 | plugins: { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。