test: harden live release checks · openclaw/openclaw@a2af805
steipete
·
2026-04-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,6 +8,7 @@ import {
|
8 | 8 | |
9 | 9 | const ZAI_KEY = process.env.ZAI_API_KEY ?? process.env.Z_AI_API_KEY ?? ""; |
10 | 10 | const LIVE = isLiveTestEnabled(["ZAI_LIVE_TEST"]); |
| 11 | +const ZAI_LIVE_TIMEOUT_MS = 45_000; |
11 | 12 | |
12 | 13 | const describeLive = LIVE && ZAI_KEY ? describe : describe.skip; |
13 | 14 | |
@@ -25,11 +26,19 @@ async function expectModelReturnsAssistantText(modelId: "glm-5" | "glm-5.1") {
|
25 | 26 | } |
26 | 27 | |
27 | 28 | describeLive("zai live", () => { |
28 | | -it("returns assistant text", async () => { |
29 | | -await expectModelReturnsAssistantText("glm-5"); |
30 | | -}, 20000); |
| 29 | +it( |
| 30 | +"returns assistant text", |
| 31 | +async () => { |
| 32 | +await expectModelReturnsAssistantText("glm-5"); |
| 33 | +}, |
| 34 | +ZAI_LIVE_TIMEOUT_MS, |
| 35 | +); |
31 | 36 | |
32 | | -it("glm-5.1 returns assistant text", async () => { |
33 | | -await expectModelReturnsAssistantText("glm-5.1"); |
34 | | -}, 20000); |
| 37 | +it( |
| 38 | +"glm-5.1 returns assistant text", |
| 39 | +async () => { |
| 40 | +await expectModelReturnsAssistantText("glm-5.1"); |
| 41 | +}, |
| 42 | +ZAI_LIVE_TIMEOUT_MS, |
| 43 | +); |
35 | 44 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,6 +27,16 @@ describe("gateway codex harness live helpers", () => {
|
27 | 27 | expect(isExpectedCodexStatusCommandText(text)).toBe(true); |
28 | 28 | }); |
29 | 29 | |
| 30 | +it("accepts current app-server status prose without the OpenClaw prefix", () => { |
| 31 | +const text = [ |
| 32 | +"Status: running on `openai/gpt-5.5` in `/tmp/openclaw-live-codex-harness/workspace/dev`.", |
| 33 | +"", |
| 34 | +"Context is at 22k / 272k tokens, with no compactions. There’s 1 active task: `/codex status`.", |
| 35 | +].join("\n"); |
| 36 | + |
| 37 | +expect(isExpectedCodexStatusCommandText(text)).toBe(true); |
| 38 | +}); |
| 39 | + |
30 | 40 | it("rejects status prose for a different codex session", () => { |
31 | 41 | const text = |
32 | 42 | "OpenClaw is running on `openai/gpt-5.5` with low reasoning/text settings. Context is at `22k/272k` tokens, no compactions, and the current session is `agent:dev:other`."; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,14 +88,17 @@ export const EXPECTED_CODEX_STATUS_COMMAND_TEXT = [
|
88 | 88 | export function isExpectedCodexStatusCommandText(text: string): boolean { |
89 | 89 | const normalized = text.toLowerCase(); |
90 | 90 | const mentionsOpenClawStatus = |
91 | | -normalized.includes("openclaw is running on") || normalized.includes("openclaw status:"); |
| 91 | +normalized.includes("openclaw is running on") || |
| 92 | +normalized.includes("openclaw status:") || |
| 93 | +normalized.includes("status: running on"); |
92 | 94 | const mentionsHarnessSession = |
93 | 95 | normalized.includes("session: `agent:dev:live-codex-harness`") || |
94 | 96 | normalized.includes("session: agent:dev:live-codex-harness") || |
95 | 97 | normalized.includes("session `agent:dev:live-codex-harness`") || |
96 | 98 | normalized.includes("current session is `agent:dev:live-codex-harness`") || |
97 | 99 | normalized.includes("current session is agent:dev:live-codex-harness") || |
98 | | -(normalized.includes("session context") && normalized.includes("active task: `/codex status`")); |
| 100 | +((normalized.includes("session context") || normalized.includes("context is at")) && |
| 101 | +normalized.includes("active task: `/codex status`")); |
99 | 102 | const mentionsModel = |
100 | 103 | normalized.includes("`openai/") || |
101 | 104 | normalized.includes(" openai/") || |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -84,6 +84,8 @@ const GATEWAY_LIVE_STRIP_SCAFFOLDING_MODEL_KEYS = new Set([
|
84 | 84 | ]); |
85 | 85 | const GATEWAY_LIVE_EXEC_READ_NONCE_MISS_SKIP_MODEL_KEYS = new Set([ |
86 | 86 | "fireworks/accounts/fireworks/models/glm-5", |
| 87 | +"fireworks/accounts/fireworks/models/kimi-k2p5", |
| 88 | +"fireworks/accounts/fireworks/models/kimi-k2p6", |
87 | 89 | "fireworks/accounts/fireworks/routers/kimi-k2p5-turbo", |
88 | 90 | "google/gemini-3.1-flash-lite-preview", |
89 | 91 | ]); |
@@ -502,6 +504,12 @@ describe("shouldSkipExecReadNonceMissForLiveModel", () => {
|
502 | 504 | expect( |
503 | 505 | shouldSkipExecReadNonceMissForLiveModel("fireworks/accounts/fireworks/models/glm-5"), |
504 | 506 | ).toBe(true); |
| 507 | +expect( |
| 508 | +shouldSkipExecReadNonceMissForLiveModel("fireworks/accounts/fireworks/models/kimi-k2p5"), |
| 509 | +).toBe(true); |
| 510 | +expect( |
| 511 | +shouldSkipExecReadNonceMissForLiveModel("fireworks/accounts/fireworks/models/kimi-k2p6"), |
| 512 | +).toBe(true); |
505 | 513 | expect( |
506 | 514 | shouldSkipExecReadNonceMissForLiveModel( |
507 | 515 | "fireworks/accounts/fireworks/routers/kimi-k2p5-turbo", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -116,7 +116,7 @@ describe("gateway multi-instance e2e", () => {
|
116 | 116 | events: chatEvents, |
117 | 117 | runId: String(runId), |
118 | 118 | sessionKey, |
119 | | -timeoutMs: 45_000, |
| 119 | +timeoutMs: 90_000, |
120 | 120 | }); |
121 | 121 | const finalText = extractFirstTextBlock(finalEvent.message); |
122 | 122 | expect(typeof finalText).toBe("string"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -465,5 +465,12 @@ export async function waitForChatFinalEvent(params: {
|
465 | 465 | } |
466 | 466 | await sleep(20); |
467 | 467 | } |
468 | | -throw new Error(`timeout waiting for final chat event (runId=${params.runId})`); |
| 468 | +const observed = params.events |
| 469 | +.filter((evt) => evt.runId === params.runId || evt.sessionKey === params.sessionKey) |
| 470 | +.map((evt) => `${evt.runId ?? "no-run"}:${evt.sessionKey ?? "no-session"}:${evt.state}`) |
| 471 | +.slice(-10) |
| 472 | +.join(", "); |
| 473 | +throw new Error( |
| 474 | +`timeout waiting for final chat event (runId=${params.runId}, sessionKey=${params.sessionKey}, observed=${observed || "none"})`, |
| 475 | +); |
469 | 476 | } |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。