fix(e2e): ignore embedded diagnostic reply json · openclaw/openclaw@ee69465
vincentkoc
·
2026-06-20
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -80,6 +80,26 @@ describe("scripts/e2e/lib/agent-turn-output", () => {
|
80 | 80 | } |
81 | 81 | }); |
82 | 82 | |
| 83 | +it("does not accept reply-shaped JSON embedded in diagnostic lines", () => { |
| 84 | +const dir = mkdtempSync(join(tmpdir(), "openclaw-e2e-agent-output-")); |
| 85 | +try { |
| 86 | +const outputPath = join(dir, "agent.log"); |
| 87 | +writeFileSync( |
| 88 | +outputPath, |
| 89 | +[ |
| 90 | +`echo ${JSON.stringify({ payloads: [{ text: "OPENCLAW_E2E_OK_DIAGNOSTIC" }] })}`, |
| 91 | +JSON.stringify({ payloads: [{ text: "real reply without marker" }] }), |
| 92 | +].join("\n"), |
| 93 | +); |
| 94 | + |
| 95 | +expect(() => |
| 96 | +assertAgentReplyContainsMarker("OPENCLAW_E2E_OK_DIAGNOSTIC", outputPath), |
| 97 | +).toThrow(/agent reply payload did not contain marker/u); |
| 98 | +} finally { |
| 99 | +rmSync(dir, { recursive: true, force: true }); |
| 100 | +} |
| 101 | +}); |
| 102 | + |
83 | 103 | it("does not accept markers that only appear in error payload text", () => { |
84 | 104 | const dir = mkdtempSync(join(tmpdir(), "openclaw-e2e-agent-output-")); |
85 | 105 | try { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。