refactor(agents): hide timeout phase predicate · openclaw/openclaw@68ef801
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,17 +2,19 @@
|
2 | 2 | import { describe, expect, it } from "vitest"; |
3 | 3 | import { |
4 | 4 | buildAgentRunTerminalOutcome, |
5 | | -isHardAgentRunTimeoutPhase, |
6 | 5 | mergeAgentRunTerminalOutcome, |
7 | 6 | } from "./agent-run-terminal-outcome.js"; |
8 | 7 | |
9 | 8 | describe("agent run terminal outcome", () => { |
10 | 9 | it("treats provider/preflight/post-turn timeout phases as hard run timeouts", () => { |
11 | | -expect(isHardAgentRunTimeoutPhase("preflight")).toBe(true); |
12 | | -expect(isHardAgentRunTimeoutPhase("provider")).toBe(true); |
13 | | -expect(isHardAgentRunTimeoutPhase("post_turn")).toBe(true); |
14 | | -expect(isHardAgentRunTimeoutPhase("queue")).toBe(false); |
15 | | -expect(isHardAgentRunTimeoutPhase("gateway_draining")).toBe(false); |
| 10 | +expect( |
| 11 | +["preflight", "provider", "post_turn", "queue", "gateway_draining"].map((timeoutPhase) => |
| 12 | +buildAgentRunTerminalOutcome({ |
| 13 | +status: "timeout", |
| 14 | + timeoutPhase, |
| 15 | +}).reason |
| 16 | +), |
| 17 | +).toEqual(["hard_timeout", "hard_timeout", "hard_timeout", "timed_out", "timed_out"]); |
16 | 18 | }); |
17 | 19 | |
18 | 20 | it("keeps queue and gateway draining timeouts non-sticky", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。