@@ -10,6 +10,7 @@ import { shouldSkipLiveProviderDrift } from "../agents/live-test-provider-drift.
|
10 | 10 | import { parseModelRef } from "../agents/model-selection.js"; |
11 | 11 | import { clearRuntimeConfigSnapshot, type OpenClawConfig } from "../config/config.js"; |
12 | 12 | import { isTruthyEnvValue } from "../infra/env.js"; |
| 13 | +import { setTestEnvValue } from "../test-utils/env.js"; |
13 | 14 | import { |
14 | 15 | applyCliBackendLiveEnv, |
15 | 16 | createBootstrapWorkspace, |
@@ -285,7 +286,7 @@ describeLive("gateway live (cli backend)", () => {
|
285 | 286 | applyCliBackendLiveEnv(preservedEnv); |
286 | 287 | |
287 | 288 | const token = `test-${randomUUID()}`; |
288 | | -process.env.OPENCLAW_GATEWAY_TOKEN = token; |
| 289 | +setTestEnvValue("OPENCLAW_GATEWAY_TOKEN", token); |
289 | 290 | const port = await getFreeGatewayPort(); |
290 | 291 | logCliBackendLiveStep("env-ready", { port }); |
291 | 292 | |
@@ -369,7 +370,7 @@ describeLive("gateway live (cli backend)", () => {
|
369 | 370 | ? await createMcpSchemaProbePlugin(tempDir) |
370 | 371 | : undefined; |
371 | 372 | const useMinimalToolsProfile = providerId === "codex-cli" && !schemaProbePluginPath; |
372 | | -process.env.OPENCLAW_STATE_DIR = stateDir; |
| 373 | +setTestEnvValue("OPENCLAW_STATE_DIR", stateDir); |
373 | 374 | const bundleMcp = backendResolved?.bundleMcp === true; |
374 | 375 | const bootstrapWorkspace = await createBootstrapWorkspace(tempDir); |
375 | 376 | const disableMcpConfig = process.env.OPENCLAW_LIVE_CLI_BACKEND_DISABLE_MCP_CONFIG !== "0"; |
@@ -473,7 +474,7 @@ describeLive("gateway live (cli backend)", () => {
|
473 | 474 | }; |
474 | 475 | const tempConfigPath = path.join(tempDir, "openclaw.json"); |
475 | 476 | await fs.writeFile(tempConfigPath, `${JSON.stringify(nextCfg, null, 2)}\n`); |
476 | | -process.env.OPENCLAW_CONFIG_PATH = tempConfigPath; |
| 477 | +setTestEnvValue("OPENCLAW_CONFIG_PATH", tempConfigPath); |
477 | 478 | const deviceIdentity = await ensurePairedTestGatewayClientIdentity(); |
478 | 479 | let server: Awaited<ReturnType<typeof startGatewayServer>> | undefined; |
479 | 480 | let client: Awaited<ReturnType<typeof connectTestGatewayClient>> | undefined; |
|