Fix Windows external bearer refresh test#16366
Merged
Conversation
etraut-openai
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#16287 introduced a change to
codex-rs/login/src/auth/auth_tests.rsthat uses a PowerShell helper to read the next token fromtokens.txtand rewrite the remainder back to disk. On Windows,Get-Contentcan 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.rsandcodex-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 testpasses when run incodex-rs/loginandcodex-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
Get-Content -Path tokens.txtin@(...)so the script always gets array semantics before counting, indexing, and rewriting the remaining lines.