Context Window Resets from 1M to ~258k When Using API Provider
Open 💬 3 comments Opened Jun 11, 2026 by wfge
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
codex-cli 0.139.0
What subscription do you have?
API Provider
Which model were you using?
gpt-5.5
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
iTerm2
Codex doctor report
What issue are you seeing?
I'm using Codex with an API Provider configuration. I have explicitly set the context window size to 1M tokens through environment variables, and the configuration appears to be loaded correctly at startup.
However, after I send any prompt, the context window immediately drops back to approximately 258k tokens. This happens consistently across sessions.
What steps can reproduce the bug?
Step 1
<img width="2050" height="716" alt="Image" src="https://github.com/user-attachments/assets/0faec269-2708-44c2-8054-2359218b278c" />
Step 2
<img width="2152" height="1312" alt="Image" src="https://github.com/user-attachments/assets/38042379-9974-4d7a-8952-0685aa196f88" />
What is the expected behavior?
_No response_
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
codex doesnot support 1M context for 5.5 actually, it was mentioned much earlier in #19464, but they rudely locked the issue.
I experience the same with 750k window and using gpt enterprise login in codex.