You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(login): resolve real codex CLI from live home, not sandbox (#18)
* fix(login): resolve real codex CLI from live home, not sandbox
User report (Windows): clicking the per-card Login button surfaced
\`C:\\Python314\\python.exe: can't open file 'C:\\Users\\32162\\.codex\\
account_backup\\windows\\login_runtime\\account_backup\\windows\\
codex_switch.py': [Errno 2] No such file or directory\`
Root cause: \`build_login_command\` was anchoring \`resolve_real_codex_cli\`
on the *runtime* CODEX_HOME (the sandbox). On Windows the user's
\`codex\` on PATH is a managed cmd shim that does
\`%CODEX_HOME%\\account_backup\\windows\\codex_switch_cli\`. The
managed-shim filter only excluded the shim that lives under the
*runtime* CODEX_HOME — it didn't filter the live shim, so the resolver
returned the live shim. Once invoked with \`CODEX_HOME=runtime_home\`,
the shim looked for \`codex_switch_cli\` (or the legacy
\`codex_switch.py\`) under the empty sandbox and failed.
`run_codex_auth_refresh` already had this split right (\`cli_codex_home\`
for resolution, \`runtime_codex_home\` for the env). Mirror that on
\`run_codex_login\`:
- `PlatformHooks::run_codex_login` now takes
\`(cli_codex_home, runtime_codex_home)\`. The legacy
\`login_current_profile\` flow passes the same path for both. The
per-card login passes the live \`~/.codex\` for resolution and the
sandbox for the env.
- Both mac and win impls split the args and use \`cli_codex_home\` only
for \`resolve_real_codex_cli\`.
- \`shared/runtime/login_runtime.rs\` now passes the live \`codex_home\`
to the hook for resolution.
- Tests updated; 40/40 still pass on mac (the previously-flaky
\`discover_real_codex_cli_path_falls_back_to_app_bundle_cli\` continues
to be parallel-only flaky due to a pre-existing PATH env race
between mac tests and win tests, unrelated to this change).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(login): also update win/switch.rs FakeHooks signature
Linux CI compiles the win runtime path (it's the `not(target_os = "macos")`
branch), so the win switch tests' FakeHooks needed the same trait
signature update as the rest of the impls. Caught by CI on PR #18 only —
the local cargo check passed because mac uses the macos runtime path.
40/40 still pass.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments