Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/paths/src/env-integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ describe('env isolation integration', () => {
expect(subprocessEnv.ANTHROPIC_API_KEY).toBeUndefined();
// Archon key present
expect(subprocessEnv.ARCHON_ONLY_KEY).toBe('trusted');
// Shell-inherited keys present
expect(subprocessEnv.PATH).toBeDefined();
expect(subprocessEnv.HOME).toBeDefined();
// Shell-inherited keys present (Windows uses "Path" casing and USERPROFILE instead of HOME)
const hasPath = subprocessEnv.PATH ?? subprocessEnv.Path;
expect(hasPath).toBeDefined();
const hasHome = subprocessEnv.HOME ?? subprocessEnv.USERPROFILE;
expect(hasHome).toBeDefined();
});

it('scenario 4: same key in both CWD and archon env — archon value wins', () => {
Expand Down
9 changes: 7 additions & 2 deletions packages/providers/src/claude/provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,13 @@ describe('ClaudeProvider', () => {

const callArgs = mockQuery.mock.calls[0][0] as { options: { env: NodeJS.ProcessEnv } };
expect(callArgs.options.env.CUSTOM_USER_KEY).toBe('user-trusted-value');
expect(callArgs.options.env.PATH).toBe(process.env.PATH);
expect(callArgs.options.env.HOME).toBe(process.env.HOME);
// Windows uses "Path" casing in spread objects and USERPROFILE instead of HOME
const envPath = callArgs.options.env.PATH ?? callArgs.options.env.Path;
const processPath = process.env.PATH ?? process.env.Path;
expect(envPath).toBe(processPath);
const envHome = callArgs.options.env.HOME ?? callArgs.options.env.USERPROFILE;
const processHome = process.env.HOME ?? process.env.USERPROFILE;
expect(envHome).toBe(processHome);

// Cleanup
if (originalKey !== undefined) process.env.CUSTOM_USER_KEY = originalKey;
Expand Down
Loading