Skip to content

Fix Windows external bearer refresh test#16366

Merged
bolinfest merged 2 commits intomainfrom
codex/windows-login-refresh-test
Mar 31, 2026
Merged

Fix Windows external bearer refresh test#16366
bolinfest merged 2 commits intomainfrom
codex/windows-login-refresh-test

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Mar 31, 2026

Why

#16287 introduced a change to codex-rs/login/src/auth/auth_tests.rs that uses a PowerShell helper to read the next token from tokens.txt and rewrite the remainder back to disk. On Windows, Get-Content can return a scalar when the file has only one remaining line, so $lines[0] reads the first character instead of the full token. That breaks the external bearer refresh test once the token list is nearly exhausted.

#16288 introduced similar changes to codex-rs/core/src/models_manager/manager_tests.rs and codex-rs/core/tests/suite/client.rs.

These went unnoticed because the failures showed up when the test was run via Cargo on Windows, but not in our Bazel harness. Figuring out that Cargo-vs-Bazel delta will happen in a follow-up PR.

Verification

On my Windows machine, I verified cargo test passes when run in codex-rs/login and codex-rs/core. Once this PR is merged, I will keep an eye on https://github.com/openai/codex/actions/workflows/rust-ci-full.yml to verify it goes green.

What changed

  • Wrap Get-Content -Path tokens.txt in @(...) so the script always gets array semantics before counting, indexing, and rewriting the remaining lines.

@bolinfest bolinfest merged commit 04ec9ef into main Mar 31, 2026
22 checks passed
@bolinfest bolinfest deleted the codex/windows-login-refresh-test branch March 31, 2026 21:44
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants