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

推荐订阅源

雷峰网
雷峰网
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
L
LangChain Blog
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
量子位
The GitHub Blog
The GitHub Blog
博客园 - 【当耐特】

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
fix(test): use API-key auth for Codex live Docker lanes ·...
vincentkoc · 2026-06-05 · via Recent Commits to openclaw:main

@@ -31,8 +31,14 @@ import { startGatewayServer } from "./server.js";

3131

const LIVE = isLiveTestEnabled();

3232

const CODEX_BIND_LIVE = isTruthyEnvValue(process.env.OPENCLAW_LIVE_CODEX_BIND);

3333

const describeLive = LIVE && CODEX_BIND_LIVE ? describe : describe.skip;

34-

const CODEX_BIND_TIMEOUT_MS = 10 * 60_000;

35-

const CODEX_BIND_REQUEST_TIMEOUT_MS = 180_000;

34+

const CODEX_BIND_TIMEOUT_MS = resolveLiveTimeoutMs(

35+

process.env.OPENCLAW_LIVE_CODEX_BIND_TIMEOUT_MS,

36+

900_000,

37+

);

38+

const CODEX_BIND_REQUEST_TIMEOUT_MS = resolveLiveTimeoutMs(

39+

process.env.OPENCLAW_LIVE_CODEX_BIND_REQUEST_TIMEOUT_MS,

40+

300_000,

41+

);

3642

const DEFAULT_CODEX_BIND_MODEL = "gpt-5.5";

37433844

type CapturedOutboundReply = {

@@ -42,6 +48,15 @@ type CapturedOutboundReply = {

4248

to: string;

4349

};

445051+

function resolveLiveTimeoutMs(raw: string | undefined, fallback: number): number {

52+

const parsed = raw ? Number(raw) : Number.NaN;

53+

return Number.isFinite(parsed) && parsed > 0 ? Math.floor(parsed) : fallback;

54+

}

55+56+

function logCodexBindStep(message: string): void {

57+

console.info(`[live-codex-bind] ${message}`);

58+

}

59+4560

function createSlackCurrentConversationBindingRegistry(outboundReplies: CapturedOutboundReply[]) {

4661

return createTestRegistry([

4762

{

@@ -164,21 +179,32 @@ function restoreEnvVar(name: string, value: string | undefined): void {

164179

process.env[name] = value;

165180

}

166181167-

async function waitForAgentRunOk(client: GatewayClient, runId: string): Promise<void> {

168-

const result: { status?: string } = await client.request(

169-

"agent.wait",

170-

{ runId, timeoutMs: CODEX_BIND_REQUEST_TIMEOUT_MS },

171-

{ timeoutMs: CODEX_BIND_REQUEST_TIMEOUT_MS + 5_000 },

172-

);

182+

async function waitForAgentRunOk(

183+

client: GatewayClient,

184+

runId: string,

185+

context: string,

186+

): Promise<void> {

187+

let result: { status?: string };

188+

try {

189+

result = await client.request(

190+

"agent.wait",

191+

{ runId, timeoutMs: CODEX_BIND_REQUEST_TIMEOUT_MS },

192+

{ timeoutMs: CODEX_BIND_REQUEST_TIMEOUT_MS + 5_000 },

193+

);

194+

} catch (error) {

195+

const message = error instanceof Error ? error.message : String(error);

196+

throw new Error(`${context}: agent.wait error for ${runId}: ${message}`, { cause: error });

197+

}

173198

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

174-

throw new Error(`agent.wait failed for ${runId}: status=${String(result?.status)}`);

199+

throw new Error(`${context}: agent.wait failed for ${runId}: status=${String(result?.status)}`);

175200

}

176201

}

177202178203

async function sendChatAndWait(params: {

179204

client: GatewayClient;

180205

sessionKey: string;

181206

idempotencyKey: string;

207+

context: string;

182208

message: string;

183209

originatingChannel: string;

184210

originatingTo: string;

@@ -201,9 +227,13 @@ async function sendChatAndWait(params: {

201227

attachments: params.attachments,

202228

});

203229

if (started?.status !== "started" || typeof started.runId !== "string") {

204-

throw new Error(`chat.send did not start correctly: ${JSON.stringify(started)}`);

230+

throw new Error(

231+

`${params.context}: chat.send did not start correctly: ${JSON.stringify(started)}`,

232+

);

205233

}

206-

await waitForAgentRunOk(params.client, started.runId);

234+

logCodexBindStep(`${params.context} started (${started.runId})`);

235+

await waitForAgentRunOk(params.client, started.runId, params.context);

236+

logCodexBindStep(`${params.context} completed`);

207237

}

208238209239

async function waitForAssistantText(params: {

@@ -344,8 +374,10 @@ async function writeGatewayConfig(params: {

344374

agents: {

345375

defaults: {

346376

workspace: params.workspace,

347-

agentRuntime: { id: "codex" },

348377

model: { primary: `${modelProvider}/${params.model}` },

378+

models: {

379+

[`${modelProvider}/${params.model}`]: { agentRuntime: { id: "codex" } },

380+

},

349381

skipBootstrap: true,

350382

heartbeat: { every: "0m" },

351383

sandbox: { mode: "off" },

@@ -462,6 +494,7 @@ describeLive("gateway live (native Codex conversation binding)", () => {

462494

client,

463495

sessionKey,

464496

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

497+

context: "bind command",

465498

message: `/codex bind --cwd ${workspace} --model ${bindModel}${

466499

bindProvider ? ` --provider ${bindProvider}` : ""

467500

}`,

@@ -481,13 +514,15 @@ describeLive("gateway live (native Codex conversation binding)", () => {

481514

accountId,

482515

conversationId,

483516

});

517+

logCodexBindStep(`binding resolved to ${boundSessionKey}`);

484518

let commandReplyCount = bindReply.outboundTexts.length;

485519486520

const sendCodexCommand = async (message: string, contains: string, timeoutMs = 60_000) => {

487521

await sendChatAndWait({

488522

client,

489523

sessionKey,

490524

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

525+

context: message,

491526

message,

492527

originatingChannel: "slack",

493528

originatingTo: conversationId,

@@ -530,6 +565,7 @@ describeLive("gateway live (native Codex conversation binding)", () => {

530565

client,

531566

sessionKey,

532567

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

568+

context: "bound text turn",

533569

message: `Reply with exactly this token and nothing else: ${textToken}`,

534570

originatingChannel: "slack",

535571

originatingTo: conversationId,

@@ -547,6 +583,7 @@ describeLive("gateway live (native Codex conversation binding)", () => {

547583

client,

548584

sessionKey,

549585

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

586+

context: "bound image turn",

550587

message:

551588

"What animal is drawn in the attached image? Reply with only the lowercase animal name.",

552589

originatingChannel: "slack",

@@ -578,7 +615,7 @@ describeLive("gateway live (native Codex conversation binding)", () => {

578615

clearRuntimeConfigSnapshot();

579616

await client.stopAndWait({ timeoutMs: 2_000 }).catch(() => {});

580617

await server.close();

581-

await fs.rm(tempRoot, { recursive: true, force: true });

618+

await fs.rm(tempRoot, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });

582619

restoreEnvVar("CODEX_HOME", previous.codexHome);

583620

restoreEnvVar("OPENCLAW_CONFIG_PATH", previous.configPath);

584621

restoreEnvVar("OPENCLAW_GATEWAY_TOKEN", previous.gatewayToken);