test: cover timeout after tool media · openclaw/openclaw@c7623f7
sallyom
·
2026-05-12
·
via Recent Commits to openclaw:main
File tree
src/agents/pi-embedded-runner
| Original file line number | Diff line number | Diff line change |
|---|
@@ -650,6 +650,31 @@ describe("overflow compaction in run loop", () => {
|
650 | 650 | ).toBe(false); |
651 | 651 | }); |
652 | 652 | |
| 653 | +it("preserves tool media payloads and appends an explicit timeout error", async () => { |
| 654 | +mockedRunEmbeddedAttempt.mockResolvedValue( |
| 655 | +makeAttemptResult({ |
| 656 | +aborted: true, |
| 657 | +timedOut: true, |
| 658 | +timedOutDuringCompaction: false, |
| 659 | +assistantTexts: [], |
| 660 | +toolMediaUrls: ["https://example.test/tool-output.png"], |
| 661 | +}), |
| 662 | +); |
| 663 | + |
| 664 | +const result = await runEmbeddedPiAgent(baseParams); |
| 665 | + |
| 666 | +expect(result.payloads).toEqual([ |
| 667 | +expect.objectContaining({ |
| 668 | +mediaUrl: "https://example.test/tool-output.png", |
| 669 | +mediaUrls: ["https://example.test/tool-output.png"], |
| 670 | +}), |
| 671 | +expect.objectContaining({ |
| 672 | +isError: true, |
| 673 | +text: expect.stringContaining("timed out"), |
| 674 | +}), |
| 675 | +]); |
| 676 | +}); |
| 677 | + |
653 | 678 | it("sets promptTokens from the latest model call usage, not accumulated attempt usage", async () => { |
654 | 679 | mockedRunEmbeddedAttempt.mockResolvedValue( |
655 | 680 | makeAttemptResult({ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。