@@ -11,6 +11,7 @@ import { stageQaMockAuthProfiles } from "../extensions/qa-lab/src/providers/shar
1111import { buildQaGatewayConfig } from "../extensions/qa-lab/src/qa-gateway-config.js" ;
1212import { resetConfigRuntimeState } from "../src/config/config.js" ;
1313import { startGatewayServer } from "../src/gateway/server.js" ;
14+ import { deleteTestEnvValue , setTestEnvValue } from "../src/test-utils/env.js" ;
1415import { writeProbeMcpServer } from "./e2e/lib/mcp-code-mode-probe-server.ts" ;
1516import {
1617 type McpCodeModeMentions ,
@@ -87,9 +88,9 @@ async function readSessionLogMentions(stateDir: string): Promise<Record<string,
8788
8889function restoreEnvValue ( key : string , value : string | undefined ) : void {
8990 if ( value === undefined ) {
90- delete process . env [ key ] ;
91+ deleteTestEnvValue ( key ) ;
9192 } else {
92- process . env [ key ] = value ;
93+ setTestEnvValue ( key , value ) ;
9394 }
9495}
9596
@@ -203,9 +204,9 @@ export async function main() {
203204 serverPath,
204205 } ) ;
205206
206- process . env . OPENCLAW_STATE_DIR = stateDir ;
207- process . env . OPENCLAW_CONFIG_PATH = configPath ;
208- process . env . OPENCLAW_TEST_FAST = "1" ;
207+ setTestEnvValue ( " OPENCLAW_STATE_DIR" , stateDir ) ;
208+ setTestEnvValue ( " OPENCLAW_CONFIG_PATH" , configPath ) ;
209+ setTestEnvValue ( " OPENCLAW_TEST_FAST" , "1" ) ;
209210 resetConfigRuntimeState ( ) ;
210211
211212 server = await startGatewayServer ( gatewayPort , {
0 commit comments