GPT-5 Context window

Resolved 💬 5 comments Opened Aug 8, 2025 by thehumanworks Closed Sep 7, 2025
💡 Likely answer: A maintainer (pakrym-oai, contributor) responded on this thread — see the highlighted reply below.

https://github.com/openai/codex/blob/431c9299d495ef771288caf0dcf5952c585f7023/codex-rs/core/src/openai_model_info.rs#L80-L83

--

Not a moan or a bug, but a question (and my assumption as to 'why'):

  • the context window for GPT-5 in the file mentioned above is set to 200k tokens in the codex-cli. Why isn't the full 400k context window being used?
  • my assumption is that it's being done as an attempt to mitigate overloading the inference servers - which I definitely can both accept and understand - can you confirm if that's the case, and if so - when will it change (rough timeline)?

View original on GitHub ↗

5 Comments

jiangying000 · 1 year ago

it would be great if
context_window: 300_000,

pakrym-oai contributor · 11 months ago

This has been fixed, the context window is updated to 272k (input tokens)

MrGusto86 · 10 months ago

yeah this limit basically comes down to asking it 1 thing and completely re-initialize Codex in VS Code and ask it 1 question again. just going back and forth discussing an approach and investigating easily ramps it up to 1000% ... currently it is executing something we discussed at 1035% 2,900k tokens....

shit really stagnated and it can not really solve anything anymore as my app grows.

thehumanworks · 10 months ago

You likely need to cleanup your app. This isn't a codex issue.

MrGusto86 · 10 months ago
You likely need to cleanup your app. This isn't a codex issue.

no it is more that if you open a new codex conversation, first discuss what you want to do, scope it properly, than plan it out, that context percentage keeps running higher and higher. And in some cases already reaching 100% on the first run. it is not a percentage of how much data it read from your app? It is the conversation context, it is the same reason in normal gpt it gets really slow if you are working for a Long time on one project and it randomly starts to forget things you agreed in the beginning. But it seems they have changed something last week, as now I am staying well within the 100% where as the weeks before I had multiple conversations that ran at 15000% + percent. maybe it was just an error in how it was displayed as I did not change anything in how I work with codex and it doesn't seem to happen anymore.