fix(doctor): repair null agents.list[].workspace values (#93105) · openclaw/openclaw@2b752ac
xydigit-sj
·
2026-06-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -187,6 +187,39 @@ describe("normalizeCompatibilityConfigValues", () => {
|
187 | 187 | ); |
188 | 188 | }); |
189 | 189 | |
| 190 | +it("removes null workspace values from agents.list entries", () => { |
| 191 | +const res = normalizeCompatibilityConfigValues({ |
| 192 | +agents: { |
| 193 | +list: [ |
| 194 | +{ id: "main", workspace: null as unknown as string }, |
| 195 | +{ id: "beta", workspace: "/beta" }, |
| 196 | +{ id: "gamma" }, |
| 197 | +], |
| 198 | +}, |
| 199 | +}); |
| 200 | + |
| 201 | +expect(res.config.agents?.list).toEqual([ |
| 202 | +{ id: "main" }, |
| 203 | +{ id: "beta", workspace: "/beta" }, |
| 204 | +{ id: "gamma" }, |
| 205 | +]); |
| 206 | +expect(res.changes).toContain("Removed null workspace value from agents.list entry."); |
| 207 | +}); |
| 208 | + |
| 209 | +it("does not alter agents.list when no workspace is null", () => { |
| 210 | +const res = normalizeCompatibilityConfigValues({ |
| 211 | +agents: { |
| 212 | +list: [{ id: "main", workspace: "/main" }, { id: "beta" }], |
| 213 | +}, |
| 214 | +}); |
| 215 | + |
| 216 | +expect(res.config.agents?.list).toEqual([ |
| 217 | +{ id: "main", workspace: "/main" }, |
| 218 | +{ id: "beta" }, |
| 219 | +]); |
| 220 | +expect(res.changes.some((change) => change.includes("workspace"))).toBe(false); |
| 221 | +}); |
| 222 | + |
190 | 223 | it("removes bindings for missing configured agents", () => { |
191 | 224 | const res = normalizeCompatibilityConfigValues({ |
192 | 225 | agents: { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。