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

推荐订阅源

WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
月光博客
月光博客
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
U
Unit 42
腾讯CDC
爱范儿
爱范儿
J
Java Code Geeks
有赞技术团队
有赞技术团队
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
B
Blog
Stack Overflow Blog
Stack Overflow Blog
GbyAI
GbyAI
T
The Blog of Author Tim Ferriss
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
Microsoft Azure Blog
Microsoft Azure Blog
T
Tailwind CSS 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
test: share Codex bind env lifecycle · openclaw/openclaw@...
shakkernerd · 2026-06-25 · via Recent Commits to openclaw:main

@@ -21,12 +21,14 @@ import {

2121

} from "../plugins/runtime.js";

2222

import { extractFirstTextBlock } from "../shared/chat-message-content.js";

2323

import { createTestRegistry } from "../test-utils/channel-plugins.js";

24+

import { deleteTestEnvValue, setTestEnvValue } from "../test-utils/env.js";

2425

import { sleep } from "../utils.js";

2526

import type { GatewayClient } from "./client.js";

2627

import {

2728

connectTestGatewayClient,

2829

getFreeGatewayPort,

2930

} from "./gateway-cli-backend.live-helpers.js";

31+

import { restoreLiveEnv, snapshotLiveEnv, type LiveEnvSnapshot } from "./live-env-test-helpers.js";

3032

import { startGatewayServer } from "./server.js";

31333234

const LIVE = isLiveTestEnabled();

@@ -172,14 +174,6 @@ async function waitForOutboundText(params: {

172174

);

173175

}

174176175-

function restoreEnvVar(name: string, value: string | undefined): void {

176-

if (value === undefined) {

177-

delete process.env[name];

178-

return;

179-

}

180-

process.env[name] = value;

181-

}

182-183177

async function waitForAgentRunOk(

184178

client: GatewayClient,

185179

runId: string,

@@ -400,17 +394,7 @@ describeLive("gateway live (native Codex conversation binding)", () => {

400394

it(

401395

"binds a Slack DM to Codex app-server, updates controls, and forwards image media paths",

402396

async () => {

403-

const previous = {

404-

codexHome: process.env.CODEX_HOME,

405-

configPath: process.env.OPENCLAW_CONFIG_PATH,

406-

gatewayToken: process.env.OPENCLAW_GATEWAY_TOKEN,

407-

home: process.env.HOME,

408-

skipCanvas: process.env.OPENCLAW_SKIP_CANVAS_HOST,

409-

skipChannels: process.env.OPENCLAW_SKIP_CHANNELS,

410-

skipCron: process.env.OPENCLAW_SKIP_CRON,

411-

skipGmail: process.env.OPENCLAW_SKIP_GMAIL_WATCHER,

412-

stateDir: process.env.OPENCLAW_STATE_DIR,

413-

};

397+

const previous: LiveEnvSnapshot = snapshotLiveEnv(["CODEX_HOME", "HOME"]);

414398

const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-live-codex-bind-"));

415399

const tempHome = path.join(tempRoot, "home");

416400

const stateDir = path.join(tempRoot, "state");

@@ -453,20 +437,20 @@ describeLive("gateway live (native Codex conversation binding)", () => {

453437

clearPluginLoaderCache();

454438

resetPluginRuntimeStateForTest();

455439

const codexHome =

456-

previous.codexHome || (previous.home ? path.join(previous.home, ".codex") : "");

440+

previous.CODEX_HOME || (previous.HOME ? path.join(previous.HOME, ".codex") : "");

457441

if (codexHome) {

458-

process.env.CODEX_HOME = codexHome;

442+

setTestEnvValue("CODEX_HOME", codexHome);

459443

} else {

460-

delete process.env.CODEX_HOME;

444+

deleteTestEnvValue("CODEX_HOME");

461445

}

462-

process.env.HOME = tempHome;

463-

process.env.OPENCLAW_CONFIG_PATH = configPath;

464-

process.env.OPENCLAW_GATEWAY_TOKEN = token;

465-

process.env.OPENCLAW_SKIP_CANVAS_HOST = "1";

466-

process.env.OPENCLAW_SKIP_CHANNELS = "1";

467-

process.env.OPENCLAW_SKIP_CRON = "1";

468-

process.env.OPENCLAW_SKIP_GMAIL_WATCHER = "1";

469-

process.env.OPENCLAW_STATE_DIR = stateDir;

446+

setTestEnvValue("HOME", tempHome);

447+

setTestEnvValue("OPENCLAW_CONFIG_PATH", configPath);

448+

setTestEnvValue("OPENCLAW_GATEWAY_TOKEN", token);

449+

setTestEnvValue("OPENCLAW_SKIP_CANVAS_HOST", "1");

450+

setTestEnvValue("OPENCLAW_SKIP_CHANNELS", "1");

451+

setTestEnvValue("OPENCLAW_SKIP_CRON", "1");

452+

setTestEnvValue("OPENCLAW_SKIP_GMAIL_WATCHER", "1");

453+

setTestEnvValue("OPENCLAW_STATE_DIR", stateDir);

470454

let server: Awaited<ReturnType<typeof startGatewayServer>> | undefined;

471455

let client: Awaited<ReturnType<typeof connectTestGatewayClient>> | undefined;

472456

let pinnedChannelRegistry:

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

631615

}

632616

} finally {

633617

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

634-

restoreEnvVar("CODEX_HOME", previous.codexHome);

635-

restoreEnvVar("OPENCLAW_CONFIG_PATH", previous.configPath);

636-

restoreEnvVar("OPENCLAW_GATEWAY_TOKEN", previous.gatewayToken);

637-

restoreEnvVar("HOME", previous.home);

638-

restoreEnvVar("OPENCLAW_SKIP_CANVAS_HOST", previous.skipCanvas);

639-

restoreEnvVar("OPENCLAW_SKIP_CHANNELS", previous.skipChannels);

640-

restoreEnvVar("OPENCLAW_SKIP_CRON", previous.skipCron);

641-

restoreEnvVar("OPENCLAW_SKIP_GMAIL_WATCHER", previous.skipGmail);

642-

restoreEnvVar("OPENCLAW_STATE_DIR", previous.stateDir);

618+

restoreLiveEnv(previous);

643619

}

644620

}

645621

},