fix(acpx): preserve codex acp auth env

This commit is contained in:
Peter Steinberger
2026-04-23 05:02:13 +01:00
parent e29abb2606
commit 3105ff2dda
2 changed files with 4 additions and 2 deletions

View File

@@ -82,7 +82,7 @@ describe("prepareAcpxCodexAuthConfig", () => {
const wrapper = await fs.readFile(wrapperPath, "utf8");
expect(wrapper).toContain(`CODEX_HOME: ${JSON.stringify(path.dirname(isolatedAuthPath))}`);
expect(wrapper).toContain("delete env[key]");
expect(wrapper).toContain("for (const key of [])");
expect(wrapper).not.toContain("test-api-key");
});

View File

@@ -9,7 +9,9 @@ import type { ResolvedAcpxPluginConfig } from "./config.js";
const CODEX_AGENT_ID = "codex";
const DEFAULT_CODEX_AUTH_PROFILE_ID = "openai-codex:default";
const CODEX_AUTH_ENV_CLEAR_KEYS = ["OPENAI_API_KEY"];
// acpx selects ACP auth methods from the OpenClaw process env before the wrapper
// launches. Keep those env vars visible to the child so its auth method matches.
const CODEX_AUTH_ENV_CLEAR_KEYS: string[] = [];
type PreparedAcpxCodexAuth = {
codexHome: string;