You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default Codex context length not matching Pro plan #7705
In the code, the context length for GPT 5.2 codex shows 400,000 tokens, which is technically correct for the API, but on the pro plan for ChatGPT, I believe you only get like 250 to 260, something like that. So, if the average user signs up with ChatGPT and uses it, they are likely to hit a context error, which forces compaction. So, it would make sense to maybe detect if it's a ChatGPT versus an API integration, and then automatically configure the defaults, maybe?
To be clear, you have to compact whether you run out of context space abruptly or not. It's just that if you have plugins like OhMyOpencode, then compaction could happen earlier at a more optimal point than the last second when you fully run out of tokens. So having a correct representation of the context by default would be nice for a lot of users.
PS love the hook system, custom hooks on compaction are a god send
@rekram1-node Is there some way that I can modify my open code JSON to fix this without having to redefine all of the models and variants that come default with the new official codex integration? Just as a temporary workaround.
I have the excact same issue, always when used just short of 270K tokens, which match the available token count when using the pro / plus sub in codex.
i use github copilot subscription and my context window is always 100k doesnt matter which model i use (even opus/gemini pro)
Yes, all models has an artificial low context window using github copilot, this is the same whether you use github copilot, or use their subscription in opencode or any other tool
I just hit the context length window error on gpt-5.2 using an API key at 275k tokens, so I believe it's not API vs Sub. AFAIK OpenAI's 400k is input 270k + output 130k, which is a bit misleading.
@rchybicki 5.2 or 5.2 codex? I believe the input limit was only set for codex models.
@rekram1-node I did hit it again today when a tool-call boiled over the limit when it tried to add a large git diff. But, believe that's the second opportunity described in the PR where you'd need a retry post compaction since you don't know tokens in advance.
From that data, ChatGPT subscription-backed Codex models appear constrained (roughly 272k input / 128k output) regardless of selected variant. So the default-vs-variant limit difference I reported was likely a mistaken read.
Activity
github-actions commentedon Jan 10, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if this doesn't address your specific case.
sam-ulrich1 commentedon Jan 10, 2026
To be clear, you have to compact whether you run out of context space abruptly or not. It's just that if you have plugins like OhMyOpencode, then compaction could happen earlier at a more optimal point than the last second when you fully run out of tokens. So having a correct representation of the context by default would be nice for a lot of users.
PS love the hook system, custom hooks on compaction are a god send
rekram1-node commentedon Jan 10, 2026
ah okay ill look into it
sam-ulrich1 commentedon Jan 10, 2026
@rekram1-node Is there some way that I can modify my open code JSON to fix this without having to redefine all of the models and variants that come default with the new official codex integration? Just as a temporary workaround.
rekram1-node commentedon Jan 11, 2026
ig show me ur config but u can do partial model overrides u dont need complete redefinitions
PSU3D0 commentedon Jan 11, 2026
Are there docs on partial model overrides?
sam-ulrich1 commentedon Jan 11, 2026
Updated config with and it worked. did not know that it was config merging
sam-ulrich1 commentedon Jan 11, 2026
nvm it did not merge. it overwrote the defaults
FBakkensen commentedon Jan 12, 2026
I have the excact same issue, always when used just short of 270K tokens, which match the available token count when using the pro / plus sub in codex.
3 remaining items
mykola-dev commentedon Jan 13, 2026
i use github copilot subscription and my context window is always 100k doesnt matter which model i use (even opus/gemini pro)
kostrse commentedon Jan 14, 2026
GPT 5.2 via OpenAI API should have 400K, right?
FBakkensen commentedon Jan 14, 2026
Yes, all models has an artificial low context window using github copilot, this is the same whether you use github copilot, or use their subscription in opencode or any other tool
rchybicki commentedon Jan 16, 2026
I just hit the context length window error on gpt-5.2 using an API key at 275k tokens, so I believe it's not API vs Sub. AFAIK OpenAI's 400k is input 270k + output 130k, which is a bit misleading.
rekram1-node commentedon Jan 16, 2026
Yeah having people report this still exists, looking into it
bndnsmth commentedon Jan 16, 2026
@rchybicki 5.2 or 5.2 codex? I believe the input limit was only set for codex models.
@rekram1-node I did hit it again today when a tool-call boiled over the limit when it tried to add a large git diff. But, believe that's the second opportunity described in the PR where you'd need a retry post compaction since you don't know tokens in advance.
rchybicki commentedon Jan 16, 2026
@brandon93s this was 5.2 non-codex
rekram1-node commentedon Jan 16, 2026
@brandon93s I think the input thing applies to all gpt-5 models
rekram1-node commentedon Jan 16, 2026
Ill double check w/ their docs and update
bndnsmth commentedon Jan 16, 2026
@rekram1-node confirmed here: https://github.com/openai/codex/blob/main/codex-rs/core/src/models_manager/model_info.rs#L250
HyunggyuJang commentedon Feb 6, 2026
Update from my side: I think my earlier interpretation was wrong.
I traced this to model metadata in pi-mono:
https://github.com/badlogic/pi-mono/blob/f9161c4d4e0d001ebfbd3ba98f0b89adb253260a/packages/ai/src/models.generated.ts#L5099
From that data, ChatGPT subscription-backed Codex models appear constrained (roughly 272k input / 128k output) regardless of selected variant. So the default-vs-variant limit difference I reported was likely a mistaken read.
Sorry about the confusion.
github-actions commentedon Apr 9, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.