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

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
U
Unit 42
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
D
DataBreaches.Net
N
Netflix TechBlog - Medium
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
Martin Fowler
Martin Fowler
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
MyScale Blog
MyScale Blog
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
罗磊的独立博客
B
Blog RSS Feed
J
Java Code Geeks
The GitHub Blog
The GitHub 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
fix(acpx): isolate Codex ACP config from desktop hooks · ...
91wan · 2026-04-26 · via Recent Commits to openclaw:main

@@ -27,6 +27,23 @@ function restoreEnv(name: keyof typeof previousEnv): void {

2727

}

2828

}

292930+

function generatedCodexPaths(stateDir: string): {

31+

configPath: string;

32+

wrapperPath: string;

33+

} {

34+

const baseDir = path.join(stateDir, "acpx");

35+

const codexHome = path.join(baseDir, "codex-home");

36+

return {

37+

configPath: path.join(codexHome, "config.toml"),

38+

wrapperPath: path.join(baseDir, "codex-acp-wrapper.mjs"),

39+

};

40+

}

41+42+

function expectCodexWrapperCommand(command: string | undefined, wrapperPath: string): void {

43+

expect(command).toContain(process.execPath);

44+

expect(command).toContain(wrapperPath);

45+

}

46+3047

afterEach(async () => {

3148

restoreEnv("CODEX_HOME");

3249

restoreEnv("OPENCLAW_AGENT_DIR");

@@ -37,10 +54,11 @@ afterEach(async () => {

3754

});

38553956

describe("prepareAcpxCodexAuthConfig", () => {

40-

it("does not synthesize a Codex ACP auth home from canonical OpenClaw OAuth", async () => {

57+

it("installs an isolated Codex ACP wrapper without synthesizing auth from canonical OpenClaw OAuth", async () => {

4158

const root = await makeTempDir();

4259

const agentDir = path.join(root, "agent");

4360

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

61+

const generated = generatedCodexPaths(stateDir);

4462

process.env.OPENCLAW_AGENT_DIR = agentDir;

4563

delete process.env.PI_CODING_AGENT_DIR;

4664

@@ -53,10 +71,10 @@ describe("prepareAcpxCodexAuthConfig", () => {

5371

stateDir,

5472

});

557356-

expect(resolved.agents.codex).toBeUndefined();

57-

await expect(

58-

fs.access(path.join(stateDir, "acpx", "codex-acp-wrapper.mjs")),

59-

).rejects.toMatchObject({ code: "ENOENT" });

74+

expectCodexWrapperCommand(resolved.agents.codex, generated.wrapperPath);

75+

await expect(fs.access(generated.wrapperPath)).resolves.toBeUndefined();

76+

const wrapper = await fs.readFile(generated.wrapperPath, "utf8");

77+

expect(wrapper).toContain('"--", "codex-acp"');

6078

await expect(

6179

fs.access(path.join(agentDir, "acp-auth", "codex", "auth.json")),

6280

).rejects.toMatchObject({ code: "ENOENT" });

@@ -66,11 +84,17 @@ describe("prepareAcpxCodexAuthConfig", () => {

6684

const root = await makeTempDir();

6785

const sourceCodexHome = path.join(root, "source-codex");

6886

const agentDir = path.join(root, "agent");

87+

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

88+

const generated = generatedCodexPaths(stateDir);

6989

await fs.mkdir(sourceCodexHome, { recursive: true });

7090

await fs.writeFile(

7191

path.join(sourceCodexHome, "auth.json"),

7292

`${JSON.stringify({ auth_mode: "apikey", OPENAI_API_KEY: "test-api-key" }, null, 2)}\n`,

7393

);

94+

await fs.writeFile(

95+

path.join(sourceCodexHome, "config.toml"),

96+

'notify = ["SkyComputerUseClient", "turn-ended"]\n',

97+

);

7498

process.env.CODEX_HOME = sourceCodexHome;

7599

process.env.OPENCLAW_AGENT_DIR = agentDir;

76100

delete process.env.PI_CODING_AGENT_DIR;

@@ -81,10 +105,16 @@ describe("prepareAcpxCodexAuthConfig", () => {

81105

});

82106

const resolved = await prepareAcpxCodexAuthConfig({

83107

pluginConfig,

84-

stateDir: path.join(root, "state"),

108+

stateDir,

85109

});

8611087-

expect(resolved.agents.codex).toBeUndefined();

111+

expectCodexWrapperCommand(resolved.agents.codex, generated.wrapperPath);

112+

const isolatedConfig = await fs.readFile(generated.configPath, "utf8");

113+

expect(isolatedConfig).not.toContain("notify");

114+

expect(isolatedConfig).not.toContain("SkyComputerUseClient");

115+

const wrapper = await fs.readFile(generated.wrapperPath, "utf8");

116+

expect(wrapper).toContain("CODEX_HOME: codexHome");

117+

expect(wrapper).not.toContain(sourceCodexHome);

88118

await expect(

89119

fs.access(path.join(agentDir, "acp-auth", "codex-source", "auth.json")),

90120

).rejects.toMatchObject({ code: "ENOENT" });

@@ -93,13 +123,22 @@ describe("prepareAcpxCodexAuthConfig", () => {

93123

).rejects.toMatchObject({ code: "ENOENT" });

94124

});

9512596-

it("does not override an explicitly configured Codex agent command", async () => {

126+

it("wraps an explicitly configured Codex agent command with isolated CODEX_HOME", async () => {

97127

const root = await makeTempDir();

128+

const sourceCodexHome = path.join(root, "source-codex");

129+

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

130+

const generated = generatedCodexPaths(stateDir);

131+

await fs.mkdir(sourceCodexHome, { recursive: true });

132+

await fs.writeFile(

133+

path.join(sourceCodexHome, "config.toml"),

134+

'notify = ["SkyComputerUseClient", "turn-ended"]\n',

135+

);

136+

process.env.CODEX_HOME = sourceCodexHome;

98137

const pluginConfig = resolveAcpxPluginConfig({

99138

rawConfig: {

100139

agents: {

101140

codex: {

102-

command: "custom-codex-acp",

141+

command: "npx @zed-industries/codex-acp@^0.11.1 -c 'model=\"gpt-5.4\"'",

103142

},

104143

},

105144

},

@@ -108,9 +147,18 @@ describe("prepareAcpxCodexAuthConfig", () => {

108147109148

const resolved = await prepareAcpxCodexAuthConfig({

110149

pluginConfig,

111-

stateDir: path.join(root, "state"),

150+

stateDir,

112151

});

113152114-

expect(resolved.agents.codex).toBe("custom-codex-acp");

153+

expectCodexWrapperCommand(resolved.agents.codex, generated.wrapperPath);

154+

expect(resolved.agents.codex).toContain("npx @zed-industries/codex-acp@^0.11.1");

155+

expect(resolved.agents.codex).toContain("-c 'model=\"gpt-5.4\"'");

156+

const isolatedConfig = await fs.readFile(generated.configPath, "utf8");

157+

expect(isolatedConfig).not.toContain("notify");

158+

expect(isolatedConfig).not.toContain("SkyComputerUseClient");

159+

const wrapper = await fs.readFile(generated.wrapperPath, "utf8");

160+

expect(wrapper).toContain("process.argv.slice(2)");

161+

expect(wrapper).toContain("CODEX_HOME: codexHome");

162+

expect(wrapper).not.toContain(sourceCodexHome);

115163

});

116164

});