diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index efa9756a0..a807ab9e2 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -116,6 +116,9 @@ ### Fixed - Fixed the cmux browser backend failing inside `cmux ssh` sessions by dialing loopback `CMUX_SOCKET_PATH` values over TCP and completing the relay HMAC-SHA256 challenge-response with credentials from the session environment or `~/.cmux/relay/.auth` ([#5788](https://github.com/can1357/oh-my-pi/issues/5788)). +### Fixed + +- Isolated the CLIProxyAPI auth-broker import tests from ambient broker configuration so fixture credentials cannot be uploaded to a live broker ([#5782](https://github.com/can1357/oh-my-pi/issues/5782)). ## [17.0.1] - 2026-07-16 diff --git a/packages/coding-agent/test/auth-broker-import.test.ts b/packages/coding-agent/test/auth-broker-import.test.ts index cea621e58..6077a3746 100644 --- a/packages/coding-agent/test/auth-broker-import.test.ts +++ b/packages/coding-agent/test/auth-broker-import.test.ts @@ -22,9 +22,14 @@ describe("auth-broker import (CLIProxyAPI)", () => { let agentDir = ""; let cliproxyDir = ""; let originalAgentDir: string | undefined; + const savedEnv: Record = {}; beforeEach(async () => { originalAgentDir = process.env.OMP_AGENT_DIR; + savedEnv.OMP_AUTH_BROKER_URL = process.env.OMP_AUTH_BROKER_URL; + savedEnv.OMP_AUTH_BROKER_TOKEN = process.env.OMP_AUTH_BROKER_TOKEN; + delete process.env.OMP_AUTH_BROKER_URL; + delete process.env.OMP_AUTH_BROKER_TOKEN; agentDir = await fs.mkdtemp(path.join(os.tmpdir(), "omp-import-agent-")); cliproxyDir = await fs.mkdtemp(path.join(os.tmpdir(), "omp-import-cliproxy-")); setAgentDir(agentDir); @@ -36,6 +41,10 @@ describe("auth-broker import (CLIProxyAPI)", () => { else process.env.OMP_AGENT_DIR = originalAgentDir; await removeWithRetries(agentDir); await removeWithRetries(cliproxyDir); + for (const key of ["OMP_AUTH_BROKER_URL", "OMP_AUTH_BROKER_TOKEN"] as const) { + if (savedEnv[key] === undefined) delete process.env[key]; + else process.env[key] = savedEnv[key]; + } }); async function writeCliProxyJson(name: string, body: Record): Promise {