fix: parse subagent depth strings strictly · openclaw/openclaw@bd773d2
steipete
·
2026-05-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -16,6 +16,18 @@ describe("getSubagentDepthFromSessionStore", () => {
|
16 | 16 | expect(depth).toBe(2); |
17 | 17 | }); |
18 | 18 | |
| 19 | +it("ignores non-decimal and unsafe stored spawnDepth strings", () => { |
| 20 | +const key = "agent:main:subagent:flat"; |
| 21 | +for (const spawnDepth of ["1e3", "0x10", "1.5", "9007199254740993"]) { |
| 22 | +const depth = getSubagentDepthFromSessionStore(key, { |
| 23 | +store: { |
| 24 | +[key]: { spawnDepth }, |
| 25 | +}, |
| 26 | +}); |
| 27 | +expect(depth).toBe(1); |
| 28 | +} |
| 29 | +}); |
| 30 | + |
19 | 31 | it("derives depth from spawnedBy ancestry when spawnDepth is missing", () => { |
20 | 32 | const key1 = "agent:main:subagent:one"; |
21 | 33 | const key2 = "agent:main:subagent:two"; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。