惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
I
InfoQ
L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
Y
Y Combinator Blog
博客园_首页
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
C
Check Point Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Engineering at Meta
Engineering at Meta
B
Blog
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
F
Fortinet All Blogs
月光博客
月光博客
GbyAI
GbyAI

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test(release): route Codex live slash checks through chat...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -31,6 +31,7 @@ import {

3131

} from "./live-agent-probes.js";

3232

import { restoreLiveEnv, snapshotLiveEnv, type LiveEnvSnapshot } from "./live-env-test-helpers.js";

3333

import { renderSolidColorPngBase64 } from "./live-image-probe.js";

34+

import type { EventFrame } from "./protocol/index.js";

34353536

const LIVE = isLiveTestEnabled();

3637

const CODEX_HARNESS_LIVE = isTruthyEnvValue(process.env.OPENCLAW_LIVE_CODEX_HARNESS);

@@ -279,29 +280,31 @@ async function requestAgentText(params: {

279280

async function requestCodexCommandText(params: {

280281

client: GatewayClient;

281282

command: string;

283+

events: EventFrame[];

282284

expectedText: string | string[];

283285

isExpectedText?: (text: string) => boolean;

284286

sessionKey: string;

285287

}): Promise<string> {

286-

const { extractPayloadText } = await import("./test-helpers.agent-results.js");

287-

const payload = await params.client.request(

288-

"agent",

288+

const runId = `idem-${randomUUID()}-codex-command`;

289+

const started = await params.client.request(

290+

"chat.send",

289291

{

290292

sessionKey: params.sessionKey,

291-

idempotencyKey: `idem-${randomUUID()}-codex-command`,

293+

idempotencyKey: runId,

292294

message: params.command,

293-

deliver: false,

294-

thinking: "low",

295-

timeout: CODEX_HARNESS_AGENT_TIMEOUT_SECONDS,

296295

},

297-

{ expectFinal: true, timeoutMs: CODEX_HARNESS_REQUEST_TIMEOUT_MS },

296+

{ timeoutMs: CODEX_HARNESS_REQUEST_TIMEOUT_MS },

298297

);

299-

if (payload?.status !== "ok") {

298+

if (started?.status !== "started") {

300299

throw new Error(

301-

`codex command ${params.command} failed: status=${String(payload?.status)} payload=${JSON.stringify(payload)}`,

300+

`codex command ${params.command} did not start correctly: ${JSON.stringify(started)}`,

302301

);

303302

}

304-

const text = extractPayloadText(payload.result);

303+

const text = await waitForChatFinalText({

304+

events: params.events,

305+

runId,

306+

timeoutMs: CODEX_HARNESS_REQUEST_TIMEOUT_MS,

307+

});

305308

const expectedTexts = Array.isArray(params.expectedText)

306309

? params.expectedText

307310

: [params.expectedText];

@@ -314,6 +317,54 @@ async function requestCodexCommandText(params: {

314317

return text;

315318

}

316319320+

async function waitForChatFinalText(params: {

321+

events: EventFrame[];

322+

runId: string;

323+

timeoutMs: number;

324+

}): Promise<string> {

325+

const deadline = Date.now() + params.timeoutMs;

326+

while (Date.now() < deadline) {

327+

const text = params.events

328+

.map((event) => extractChatFinalText(event, params.runId))

329+

.find(Boolean);

330+

if (text) {

331+

return text;

332+

}

333+

await delay(50);

334+

}

335+

throw new Error(`timed out waiting for chat final for ${params.runId}`);

336+

}

337+338+

function extractChatFinalText(event: EventFrame, runId: string): string | undefined {

339+

if (event.event !== "chat") {

340+

return undefined;

341+

}

342+

const payload = event.payload;

343+

if (!payload || typeof payload !== "object") {

344+

return undefined;

345+

}

346+

const record = payload as Record<string, unknown>;

347+

if (record.runId !== runId || record.state !== "final") {

348+

return undefined;

349+

}

350+

const message = record.message;

351+

if (!message || typeof message !== "object") {

352+

return undefined;

353+

}

354+

const messageRecord = message as Record<string, unknown>;

355+

if (typeof messageRecord.text === "string" && messageRecord.text.trim()) {

356+

return messageRecord.text;

357+

}

358+

const content = Array.isArray(messageRecord.content) ? messageRecord.content : [];

359+

return content

360+

.map((entry) =>

361+

entry && typeof entry === "object" ? (entry as Record<string, unknown>).text : undefined,

362+

)

363+

.filter((entry): entry is string => typeof entry === "string" && entry.trim().length > 0)

364+

.join("\n")

365+

.trim();

366+

}

367+317368

async function verifyCodexImageProbe(params: {

318369

client: GatewayClient;

319370

sessionKey: string;

@@ -752,6 +803,7 @@ describeLive("gateway live (Codex harness)", () => {

752803

const deviceIdentity = await ensurePairedTestGatewayClientIdentity({

753804

displayName: "vitest-codex-harness-live",

754805

});

806+

const gatewayEvents: EventFrame[] = [];

755807

logCodexLiveStep("config-written", { configPath, modelKey, port });

756808757809

const server = await startGatewayServer(port, {

@@ -766,6 +818,9 @@ describeLive("gateway live (Codex harness)", () => {

766818

timeoutMs: GATEWAY_CONNECT_TIMEOUT_MS,

767819

requestTimeoutMs: CODEX_HARNESS_REQUEST_TIMEOUT_MS,

768820

clientDisplayName: "vitest-codex-harness-live",

821+

onEvent: (event) => {

822+

gatewayEvents.push(event);

823+

},

769824

});

770825

logCodexLiveStep("client-connected");

771826

@@ -811,6 +866,7 @@ describeLive("gateway live (Codex harness)", () => {

811866812867

const statusText = await requestCodexCommandText({

813868

client,

869+

events: gatewayEvents,

814870

sessionKey,

815871

command: "/codex status",

816872

expectedText: [...EXPECTED_CODEX_STATUS_COMMAND_TEXT],

@@ -820,6 +876,7 @@ describeLive("gateway live (Codex harness)", () => {

820876821877

const modelsText = await requestCodexCommandText({

822878

client,

879+

events: gatewayEvents,

823880

sessionKey,

824881

command: "/codex models",

825882

expectedText: [...EXPECTED_CODEX_MODELS_COMMAND_TEXT],