Codex ran out of room in the model's context window. Start a new conversation or clear earlier history before retrying.
Resolved 💬 45 comments Opened Oct 8, 2025 by furkancak1r Closed Nov 18, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.45.0
Which model were you using?
codex 5 high
What platform is your computer?
wsl
What steps can reproduce the bug?
it gives me this error out of nowhere : Codex ran out of room in the model's context window. Start a new
conversation or clear earlier history before retrying.
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
45 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Same here.
MacOS
Codex 0.45.0
auto compact needed.
Same here. Please fix this. We need a more intelligent autocompact
same here. started new one and keeps showing. can't do anything
Same here, all of a sudden Codex bricked itself 🧱 macOS, 0.45.0 and 0.46.0, no change after the update. Occasionally happens minutes into a new session already.
Seeing also, macOS 26.1b2 in case germane.
Same here on Windows.
same, very painful.
same here
I've been encountering this constantly
Got this error today. Need auto context compression.
same here
from shijie.rao:
VSC extension
Same here, even typing "hello" causes this.
Completely unusable. Happening with any Codex model. Uninstalling, signing out didn't fix.
Switching to Claude Code.
I am seeing the issue on codex-cli 0.46.0 .
Moreover. when you try to "/compact" , context window gets to 100%.
Having the same issue as well, and I don't see any way to clear the earlier history either
same here:
codex-cli 0.46.0
Account: xxx (Pro)
Context window: 100% left (0 used / 272K)
5h limit: [░░░░░░░░░░░░░░░░░░░░] 0% used
Weekly limit: [█░░░░░░░░░░░░░░░░░░░] 5% used
/compactsummarize conversation to prevent hitting the context limit and/newstart a new chat during a conversationAnyways, this is probably an annoying bug
/newseems to be the only wayI noticed that this has happened to me when I'm using Chrome DevTools (MCP) and it takes a screenshot, the context consumes absurdly and the bug reaches 0 and then shows 100% context left
Thank you very much @lordisp. I have been using the Codex Chat app on VS Code, but now I had to learn to use the cli.
I am experiencing this using Chrom DevTools as well, anxiously waiting for a solution.
I'm experiencing the same issue with codex-CLI on WSL2, using version 0.47.0.
My work primarily involves using MCP tools (like serena, playwright, etc.), but I keep getting the "Codex ran out of room in the model's context window" message after very little thinking/operation. When I try commands like /compact, the current conversation window shows "Re-connecting... 10/10" until it eventually fails. The only solution that works for me is completely restarting with a new window.
Exactly. Same here.
I had the same issue, but when I ran ``
/compact`` when there was about 20% left, the bug didn't appear and it ran normally.3 times today after updating to codex-cli 0.47.0 and after doing a /compact
■ Codex ran out of room in the model's context window. Start a new conversation or clear earlier history before retrying.
/status
╭────────────────────────────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.47.0)
│
│ Model: gpt-5-codex (reasoning high, summaries auto)
│ Directory: ~/xxx/xxx
│ Approval: never
│ Sandbox: danger-full-access
│ Agents.md: AGENTS.md
│ Account: xxx (Pro)
│ Session: xxx
│
│ Context window: 100% left (0 used / 272K)
│ 5h limit: [██░░░░░░░░░░░░░░░░░░] 9% used (resets 00:45 on 19 Oct)
│ Weekly limit: [█░░░░░░░░░░░░░░░░░░░] 4% used (resets 04:18 on 25 Oct)
╰────────────────────────────────────────────────────────────────────────────╯
I also recognized, the issue always comes with the chrome-devtools.
Same problem with codex-cli 0.47.0 on MacOS Sequoia 15.6.1 (Intel Core i7)
There must be a feature in the Codex CLI/VS Code extension that allows us to manage the context as it approaches its limit. In other words, it should summarize the context, similar to how other tools like cursor and Codex do. It would be disruptive and unusable to lose all the context and start over while working on deeper analysis, fixing things, and prototyping. Codex needs to address this limitation. Otherwise, all the valuable work you’ve done by bringing Codex to this point will not be utilized beyond creating small games, as you demonstrated.
just make it like claude code?
dear god, no!
Same here using Codex and Playwright. It throws the false positive error after taking a screenshot of the browser in Playwright
it seems to have cleared up on my end, I think it was I was at the max on the limits, since running /status and there being plenty of room this has gone away. and now with the lastest update they have a graphical interface showing the limit allocations, which is helpful.
I'm having the same when Codex takes a snapshot of the browser via BrowserMCP. This makes the server useless for me.
I'd never had this problem until my first use of https://github.com/microsoft/playwright-mcp (calling
playwright.browser_take_screenshot), which gave the error "Codex ran out of room in the model's context window. Start a new conversation or clear earlier history before retrying." The screenshot itself is only 1MBSame problem with WSL2 using Ubuntu 22.04. Using either playwright MCP or chrome dev tools MCP servers.
Please fix this omg, you know how disruptive this could be, to start over a new session and have to giving the new session the entire storyline? it's just completely wasting of time and resources, and even sometimes it just cannot recover from there.
This issue has remained for 5 versions now. Can this be fixed???? Totally prevents the full utilisation of Chrome Dev tools
shoot, I thought the problem was fixed with a usage limit being reset, I just upgraded to pro, and I just got the warning early on in a new session using v0.50.0 and I have tons of available usage.
I am testing a new workflow where I use the Codex Extension in VS Code, and tried changing the model to gpt-5 high and it appeared to be working better, but just got hit with Failed Codex ran out of room in the model's context window. Start a new conversation or clear earlier history before retrying.
Same problem on VSC ith last update
Since this bug report was filed, we've fixed a number of context-related bugs and introduced an auto compaction feature. I'm going to close this one, but if you hit a similar issue with the latest version of codex, please open a fresh issue and use the
/feedbackfeature to upload details about the session.Same problem on Windsurf with last update
If you're seeing an issue with the latest version of codex, please file a new bug report and use the
/feedbackfeature to upload details about the session.Locking to prevent additional responses.