test(gateway): preserve live Codex api-key auth · openclaw/openclaw@d626e99
vincentkoc
·
2026-06-14
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -19,6 +19,8 @@ import { extractPayloadText } from "./test-helpers.agent-results.js";
|
19 | 19 | const LIVE = isLiveTestEnabled(); |
20 | 20 | const CODEX_HARNESS_LIVE = process.env.OPENCLAW_LIVE_CODEX_HARNESS === "1"; |
21 | 21 | const CODEX_HARNESS_DEBUG = process.env.OPENCLAW_LIVE_CODEX_HARNESS_DEBUG === "1"; |
| 22 | +const CODEX_HARNESS_AUTH_MODE = |
| 23 | +process.env.OPENCLAW_LIVE_CODEX_HARNESS_AUTH === "api-key" ? "api-key" : "codex-auth"; |
22 | 24 | const describeLive = LIVE && CODEX_HARNESS_LIVE ? describe : describe.skip; |
23 | 25 | const LIVE_TIMEOUT_MS = 420_000; |
24 | 26 | const GATEWAY_CONNECT_TIMEOUT_MS = 60_000; |
@@ -199,8 +201,14 @@ describeLive("gateway live trajectory export", () => {
|
199 | 201 | |
200 | 202 | clearRuntimeConfigSnapshot(); |
201 | 203 | process.env.OPENCLAW_AGENT_RUNTIME = "codex"; |
202 | | -delete process.env.OPENAI_BASE_URL; |
203 | | -delete process.env.OPENAI_API_KEY; |
| 204 | +// API-key CI lanes intentionally pass OPENAI_API_KEY through to the Codex |
| 205 | +// app-server harness; only stored Codex-auth runs should clear OpenAI env. |
| 206 | +if (CODEX_HARNESS_AUTH_MODE !== "api-key") { |
| 207 | +delete process.env.OPENAI_BASE_URL; |
| 208 | +delete process.env.OPENAI_API_KEY; |
| 209 | +} else if (!process.env.OPENAI_BASE_URL?.trim()) { |
| 210 | +delete process.env.OPENAI_BASE_URL; |
| 211 | +} |
204 | 212 | process.env.OPENCLAW_CONFIG_PATH = configPath; |
205 | 213 | process.env.OPENCLAW_GATEWAY_TOKEN = token; |
206 | 214 | process.env.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER = "1"; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。