fix(doctor): respect default-account route coverage · openclaw/openclaw@f79b846
stainlu
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
src/commands/doctor/shared
| Original file line number | Diff line number | Diff line change |
|---|
@@ -574,7 +574,7 @@ describe("doctor preview warnings", () => {
|
574 | 574 | expect(warnings.join("\n")).not.toContain("defaults"); |
575 | 575 | }); |
576 | 576 | |
577 | | -it("warns for default-routed configured channels when other routes exist", () => { |
| 577 | +it("warns only for configured channels not covered by channel routes", () => { |
578 | 578 | const warnings = collectChannelBoundMessageToolPolicyWarnings({ |
579 | 579 | channels: { |
580 | 580 | discord: {}, |
@@ -608,8 +608,9 @@ describe("doctor preview warnings", () => {
|
608 | 608 | }); |
609 | 609 | |
610 | 610 | expect(warnings).toEqual([ |
611 | | -expect.stringContaining('Agent "main" is routed from channel "discord" and "telegram"'), |
| 611 | +expect.stringContaining('Agent "main" is routed from channel "telegram"'), |
612 | 612 | ]); |
| 613 | +expect(warnings.join("\n")).not.toContain("discord"); |
613 | 614 | expect(warnings.join("\n")).not.toContain("commander"); |
614 | 615 | }); |
615 | 616 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -321,11 +321,13 @@ function collectBoundChannelTargets(cfg: OpenClawConfig): Array<{
|
321 | 321 | continue; |
322 | 322 | } |
323 | 323 | const configuredAccountIds = listConfiguredChannelAccountIds(cfg, channel); |
| 324 | +const coveredAccounts = coveredAccountsByChannel.get(channel); |
324 | 325 | if (configuredAccountIds.length === 0) { |
325 | | -add(defaultAgentId, channel); |
| 326 | +if (!coveredAccounts?.has(DEFAULT_ACCOUNT_ID)) { |
| 327 | +add(defaultAgentId, channel); |
| 328 | +} |
326 | 329 | continue; |
327 | 330 | } |
328 | | -const coveredAccounts = coveredAccountsByChannel.get(channel); |
329 | 331 | if (configuredAccountIds.some((accountId) => !coveredAccounts?.has(accountId))) { |
330 | 332 | add(defaultAgentId, channel); |
331 | 333 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。