From 3e4b59fa945ac3be57e8c9b0ebf081f4509334ad Mon Sep 17 00:00:00 2001 From: roboomp Date: Thu, 13 Aug 2026 15:51:06 +0000 Subject: [PATCH] test(discovery): cleared inherited CLAUDE_CONFIG_DIR in setup Legacy-path Claude discovery tests now unset an inherited override in beforeEach so they read the fixtures under their temp homes; relocation cases still set it explicitly. --- packages/coding-agent/test/discovery/claude-commands.test.ts | 1 + packages/coding-agent/test/discovery/claude-plugins.test.ts | 5 +++++ packages/coding-agent/test/foreign-session-stores.test.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/packages/coding-agent/test/discovery/claude-commands.test.ts b/packages/coding-agent/test/discovery/claude-commands.test.ts index 30774cf15..461c7ac8d 100644 --- a/packages/coding-agent/test/discovery/claude-commands.test.ts +++ b/packages/coding-agent/test/discovery/claude-commands.test.ts @@ -25,6 +25,7 @@ describe("Claude Code slash command discovery", () => { resetSettingsForTest(); originalHome = process.env.HOME; originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR; + delete process.env.CLAUDE_CONFIG_DIR; root = await fs.mkdtemp(path.join(os.tmpdir(), "omp-claude-commands-")); home = path.join(root, "home"); project = path.join(root, "project"); diff --git a/packages/coding-agent/test/discovery/claude-plugins.test.ts b/packages/coding-agent/test/discovery/claude-plugins.test.ts index f7ab94501..aa28719dd 100644 --- a/packages/coding-agent/test/discovery/claude-plugins.test.ts +++ b/packages/coding-agent/test/discovery/claude-plugins.test.ts @@ -86,6 +86,7 @@ describe("listClaudePluginRoots", () => { originalOmpProfileEnv = process.env.OMP_PROFILE; originalPiProfileEnv = process.env.PI_PROFILE; originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR; + delete process.env.CLAUDE_CONFIG_DIR; tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "claude-plugins-test-")); testAgentDir = await fs.mkdtemp(path.join(os.tmpdir(), "claude-plugins-test-agent-")); process.env.HOME = tempDir; @@ -1378,15 +1379,19 @@ describe("listClaudePluginRoots", () => { describe("discoverAgents plugin precedence", () => { let tempDir: string; + let originalClaudeConfigDir: string | undefined; beforeEach(async () => { clearClaudePluginRootsCache(); clearFsCache(); + originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR; + delete process.env.CLAUDE_CONFIG_DIR; tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "claude-plugins-precedence-test-")); }); afterEach(async () => { clearClaudePluginRootsCache(); + restoreEnvValue("CLAUDE_CONFIG_DIR", originalClaudeConfigDir); await removeWithRetries(tempDir); }); diff --git a/packages/coding-agent/test/foreign-session-stores.test.ts b/packages/coding-agent/test/foreign-session-stores.test.ts index 4b92d066c..e3af3e875 100644 --- a/packages/coding-agent/test/foreign-session-stores.test.ts +++ b/packages/coding-agent/test/foreign-session-stores.test.ts @@ -17,6 +17,7 @@ let originalClaudeConfigDir: string | undefined; beforeEach(async () => { tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "omp-foreign-sessions-")); originalClaudeConfigDir = process.env.CLAUDE_CONFIG_DIR; + delete process.env.CLAUDE_CONFIG_DIR; }); afterEach(async () => {