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_

View original on GitHub ↗

45 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #4924
  • #4868

Powered by Codex Action

wo0d · 9 months ago

Same here.
MacOS
Codex 0.45.0

auto compact needed.

PacooMC · 9 months ago

Same here. Please fix this. We need a more intelligent autocompact

javothemes · 9 months ago

same here. started new one and keeps showing. can't do anything

matthiasn · 9 months ago

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.

HunterHillegas · 9 months ago

Seeing also, macOS 26.1b2 in case germane.

wadamczyk-insolutions · 9 months ago

Same here on Windows.

Gravezzz · 9 months ago

same, very painful.

thedude0606 · 9 months ago

same here

kevinjohncutler · 9 months ago

I've been encountering this constantly

UI369 · 9 months ago

Got this error today. Need auto context compression.

gugabyte · 9 months ago

same here

linear[bot] · 9 months ago

from shijie.rao:

Is this an issue on the CLI or the VSC extension? Or both?
gugabyte · 9 months ago
from shijie.rao: > Is this an issue on the CLI or the VSC extension? Or both?

VSC extension

Haruki-Shibuya · 9 months ago

Same here, even typing "hello" causes this.
Completely unusable. Happening with any Codex model. Uninstalling, signing out didn't fix.

Switching to Claude Code.

uri-gil · 9 months ago

I am seeing the issue on codex-cli 0.46.0 .
Moreover. when you try to "/compact" , context window gets to 100%.

Cofucan · 9 months ago

Having the same issue as well, and I don't see any way to clear the earlier history either

lordisp · 9 months ago

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

lordisp · 9 months ago
@Cofucan Having the same issue as well, and I don't see any way to clear the earlier history either

/compact summarize conversation to prevent hitting the context limit and
/new start a new chat during a conversation

Anyways, this is probably an annoying bug

yong6210 · 9 months ago

/new seems to be the only way

brunocunha00 · 9 months ago

I 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

Cofucan · 9 months ago
> @Cofucan Having the same issue as well, and I don't see any way to clear the earlier history either /compact summarize conversation to prevent hitting the context limit and /new start a new chat during a conversation Anyways, this is probably an annoying bug

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.

noel4nopun · 9 months ago
I 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

I am experiencing this using Chrom DevTools as well, anxiously waiting for a solution.

sd68515 · 9 months ago

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.

■ Codex ran out of room in the model's context window. Start a new conversation or clear earlier history before
retrying.
/compact
■ unexpected status 400 Bad Request: {
  "error": {
    "message": "No tool call found for function call output with call_id call_uydTBWgcp3oO1TmeYULBfhqq.",
    "type": "invalid_request_error",
    "param": "input",
    "code": null
  }
}
/status

╭─────────────────────────────────────────────────────────────────────────────╮
│  >_ OpenAI Codex (v0.47.0)                                                  │
│                                                                             │
│  Model:            gpt-5-codex (reasoning high, summaries auto)             │
│  Approval:         never                                                    │
│  Sandbox:          danger-full-access                                       │
│  Token usage:      0 total  (0 input + 0 output)                            │
│  Context window:   100% left (0 used / 272K)                                │
│  24h limit:        [███░░░░░░░░░░░░░░░░░] 15% used (resets 00:00 on 19 Oct) │
╰─────────────────────────────────────────────────────────────────────────────╯
Cofucan · 9 months ago
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. `` ■ Codex ran out of room in the model's context window. Start a new conversation or clear earlier history before retrying. /compact ■ unexpected status 400 Bad Request: { "error": { "message": "No tool call found for function call output with call_id call_uydTBWgcp3oO1TmeYULBfhqq.", "type": "invalid_request_error", "param": "input", "code": null } } /status ╭─────────────────────────────────────────────────────────────────────────────╮ │ >_ OpenAI Codex (v0.47.0) │ │ │ │ Model: gpt-5-codex (reasoning high, summaries auto) │ │ Approval: never │ │ Sandbox: danger-full-access │ │ Token usage: 0 total (0 input + 0 output) │ │ Context window: 100% left (0 used / 272K) │ │ 24h limit: [███░░░░░░░░░░░░░░░░░] 15% used (resets 00:00 on 19 Oct) │ ╰─────────────────────────────────────────────────────────────────────────────╯ ``

Exactly. Same here.

yong6210 · 9 months ago

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.

cadric · 9 months ago

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)
╰────────────────────────────────────────────────────────────────────────────╯

lordisp · 9 months ago
> I 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 I am experiencing this using Chrom DevTools as well, anxiously waiting for a solution.

I also recognized, the issue always comes with the chrome-devtools.

╭────────────────────────────────────────────────────────────────────────────╮
│  >_ OpenAI Codex (v0.47.0)                                                 │
│                                                                            │
│  Model:            gpt-5-codex (reasoning high, summaries auto)            │
│  Approval:         never                                                   │
│  Sandbox:          danger-full-access                                      │
│  Agents.md:        AGENTS.md                                               │
│  Account:          foo.bar@baz.com (Pro)                                   │
│                                                                            │
│  Context window:   100% left (0 used / 272K)                               │
│  5h limit:         [█░░░░░░░░░░░░░░░░░░░] 4% used (resets 06:41)           │
│  Weekly limit:     [█░░░░░░░░░░░░░░░░░░░] 4% used (resets 11:53 on 25 Oct) │
╰────────────────────────────────────────────────────────────────────────────╯
aidogmf · 9 months ago

Same problem with codex-cli 0.47.0 on MacOS Sequoia 15.6.1 (Intel Core i7)

Adminto64 · 9 months ago

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.

sprappcom · 9 months ago

just make it like claude code?

dieFiorav · 9 months ago
just make it like claude code?

dear god, no!

mzavattaro · 8 months ago

Same here using Codex and Playwright. It throws the false positive error after taking a screenshot of the browser in Playwright

noel4nopun · 8 months ago

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.

daltunay · 8 months ago

I'm having the same when Codex takes a snapshot of the browser via BrowserMCP. This makes the server useless for me.

davidgilbertson contributor · 8 months ago

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 1MB

Luzivog · 8 months ago

Same problem with WSL2 using Ubuntu 22.04. Using either playwright MCP or chrome dev tools MCP servers.

Lau-Tsz-Yueng · 8 months ago

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.

jamolot · 8 months ago

This issue has remained for 5 versions now. Can this be fixed???? Totally prevents the full utilisation of Chrome Dev tools

noel4nopun · 8 months ago

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.

noel4nopun · 8 months ago

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.

ateliersam86 · 8 months ago

Same problem on VSC ith last update

etraut-openai contributor · 8 months ago

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 /feedback feature to upload details about the session.

Bibyte · 7 months ago

Same problem on Windsurf with last update

etraut-openai contributor · 7 months ago

If you're seeing an issue with the latest version of codex, please file a new bug report and use the /feedback feature to upload details about the session.

Locking to prevent additional responses.