























@@ -39,6 +39,9 @@ const LIVE = isLiveTestEnabled();
3939const CLI_LIVE = isTruthyEnvValue(process.env.OPENCLAW_LIVE_CLI_BACKEND);
4040const CLI_RESUME = isTruthyEnvValue(process.env.OPENCLAW_LIVE_CLI_BACKEND_RESUME_PROBE);
4141const CLI_DEBUG = isTruthyEnvValue(process.env.OPENCLAW_LIVE_CLI_BACKEND_DEBUG);
42+const CLI_CI_SAFE_CODEX_CONFIG = isTruthyEnvValue(
43+process.env.OPENCLAW_LIVE_CLI_BACKEND_USE_CI_SAFE_CODEX_CONFIG,
44+);
4245const describeLive = LIVE && CLI_LIVE ? describe : describe.skip;
43464447const DEFAULT_PROVIDER = "claude-cli";
@@ -47,6 +50,11 @@ const DEFAULT_MODEL =
4750// The cron/MCP live probe now tolerates more cancelled tool-call retries in CI,
4851// so the outer test budget needs enough headroom to finish those retries.
4952const CLI_BACKEND_LIVE_TIMEOUT_MS = 720_000;
53+const CLI_BACKEND_REQUEST_TIMEOUT_MS = 240_000;
54+const CLI_BACKEND_AGENT_TIMEOUT_SECONDS = Math.max(
55+1,
56+Math.ceil(CLI_BACKEND_REQUEST_TIMEOUT_MS / 1000) - 10,
57+);
50585159function logCliBackendLiveStep(step: string, details?: Record<string, unknown>): void {
5260if (!CLI_DEBUG) {
@@ -248,8 +256,9 @@ describeLive("gateway live (cli backend)", () => {
248256" Do not include the note in your reply."
249257 : `Reply with exactly: CLI backend OK ${nonce}.`,
250258deliver: false,
259+timeout: CLI_BACKEND_AGENT_TIMEOUT_SECONDS,
251260},
252-{ expectFinal: true },
261+{ expectFinal: true, timeoutMs: CLI_BACKEND_REQUEST_TIMEOUT_MS },
253262);
254263if (payload?.status !== "ok") {
255264throw new Error(`agent status=${String(payload?.status)}`);
@@ -299,8 +308,9 @@ describeLive("gateway live (cli backend)", () => {
299308`What session note did I ask you to remember earlier? ` +
300309`Reply with exactly: CLI backend SWITCH OK ${switchNonce} <remembered-note>.`,
301310deliver: false,
311+timeout: CLI_BACKEND_AGENT_TIMEOUT_SECONDS,
302312},
303-{ expectFinal: true },
313+{ expectFinal: true, timeoutMs: CLI_BACKEND_REQUEST_TIMEOUT_MS },
304314);
305315if (switchPayload?.status !== "ok") {
306316throw new Error(`switch status=${String(switchPayload?.status)}`);
@@ -326,8 +336,9 @@ describeLive("gateway live (cli backend)", () => {
326336 ? `Please include the token CLI-RESUME-${resumeNonce} in your reply.`
327337 : `Reply with exactly: CLI backend RESUME OK ${resumeNonce}.`,
328338deliver: false,
339+timeout: CLI_BACKEND_AGENT_TIMEOUT_SECONDS,
329340},
330-{ expectFinal: true },
341+{ expectFinal: true, timeoutMs: CLI_BACKEND_REQUEST_TIMEOUT_MS },
331342);
332343if (resumePayload?.status !== "ok") {
333344throw new Error(`resume status=${String(resumePayload?.status)}`);
@@ -368,16 +379,23 @@ describeLive("gateway live (cli backend)", () => {
368379senderIsOwner: true,
369380});
370381logCliBackendLiveStep("cron-mcp-loopback-preflight:done");
371-logCliBackendLiveStep("cron-mcp-probe:start", { sessionKey });
372-await verifyCliCronMcpProbe({
373- client,
374- providerId,
375- sessionKey,
376- port,
377- token,
378-env: process.env,
379-});
380-logCliBackendLiveStep("cron-mcp-probe:done");
382+if (providerId === "codex-cli" && CLI_CI_SAFE_CODEX_CONFIG) {
383+logCliBackendLiveStep("cron-mcp-probe:skipped", {
384+ providerId,
385+reason: "ci-safe-codex-config",
386+});
387+} else {
388+logCliBackendLiveStep("cron-mcp-probe:start", { sessionKey });
389+await verifyCliCronMcpProbe({
390+ client,
391+ providerId,
392+ sessionKey,
393+ port,
394+ token,
395+env: process.env,
396+});
397+logCliBackendLiveStep("cron-mcp-probe:done");
398+}
381399}
382400} finally {
383401logCliBackendLiveStep("cleanup:start");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。