Skip to content

Make transfer tests hermetic on Windows (HOME vs USERPROFILE) - #596

Closed
zebbern wants to merge 1 commit into
openai:mainfrom
zebbern:fix-transfer-test-userprofile
Closed

Make transfer tests hermetic on Windows (HOME vs USERPROFILE)#596
zebbern wants to merge 1 commit into
openai:mainfrom
zebbern:fix-transfer-test-userprofile

Conversation

@zebbern

@zebbern zebbern commented Aug 5, 2026

Copy link
Copy Markdown

The transfer tests sandbox the home directory by setting HOME in the
child env, but Node's os.homedir() on Windows resolves via USERPROFILE,
so the spawned codex-companion computed the Claude projects dir from the
real user profile. The sandboxed transcript then failed the projects-dir
containment check before the behavior under test could run ("Codex can
import Claude sessions only from C:\Users\<real user>\.claude\..."), and
worse, the tests depended on whatever ~/.claude state the host happened
to have.

Set USERPROFILE alongside HOME in each transfer test's child env. POSIX
platforms ignore USERPROFILE, so nothing changes there.

On a Windows 11 host this flips three previously failing tests:
- transfer delegates the current Claude session directly to native import
- transfer reports an actionable upgrade error when native import is unsupported
- transfer fails visibly when native import completes without a ledger record

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the transfer runtime tests hermetic on Windows by ensuring the spawned Node process resolves os.homedir() to the test-created temporary home directory (Windows prefers USERPROFILE over HOME).

Changes:

  • Set USERPROFILE alongside HOME for the transfer-related test invocations.
  • Align environment setup across the transfer tests so path resolution stays within the test temp directory on Windows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zebbern

zebbern commented Aug 5, 2026

Copy link
Copy Markdown
Author

Withdrawing this PR.

@zebbern zebbern closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants