Often exceeding context window (but still 84% context left)
Resolved 💬 4 comments Opened Sep 29, 2025 by MauScheff Closed Oct 16, 2025
What version of Codex is running?
0.42
Which model were you using?
gpt-5-codex
What platform is your computer?
Darwin 24.6.0 x86_64 i386
What steps can reproduce the bug?
In the latest version, after a big task with gpt-5-codex medium I'm often running into:
⚠️ stream error: stream disconnected before completion: Your input exceeds the context window of this
model. Please adjust your input and try again.; retrying 5/5 in 3.505s…
■ stream disconnected before completion: Your input exceeds the context window of this model. Please
adjust your input and try again.
▌ Summarize recent commits
⏎ send ⌃J newline ⌃T transcript ⌃C quit 119K tokens used 84% context left
I try /compact and the error still there.
Accessing through API_KEY.
What is the expected behavior?
I used to be able to go very long before running out context and actually not error out, instead just started not working as well and then /compact ed and improved behavior, or started a new session.
What do you see instead?
Erroring out quickly.
Additional information
■ stream disconnected before completion: Your input exceeds the context window of this model. Please
adjust your input and try again.
Token usage: total=119,076 input=107,201 (+ 1,871,616 cached) output=11,875 (reasoning 7,744)
To continue this session, run codex resume 01999579-12ad-7601-9d1d-0d6d24b20214.
4 Comments
Have you used MCP? As far as I understand, with MCP, tokens are not included in statistics, but the context is consumed very heavily.
No MCP usage - I’m a regular CLI user.
On Mon 29 Sep 2025 at 21:09 slonce70 @.***> wrote:
I do use MCP but not working with 0.42.0. Gives timeout when starting. Close to context 2% and working, this error shows up. Should somehow trigger autocompact (stop in the middle or before starting to work). After codex aborts due too many failed attempts, later If I run compact the problem gets solved and I get back to 100% context.
I'm not seeing this anymore after last update, closing.