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
How to enable 1M context in OpenCode for GPT-5.4? Compaction triggers at 272k, not 1M #16308
I see that OpenAI (e.g., GPT-5.4 or Claude 3.5) officially advertises 1M context window support, but when using these models in OpenCode, compaction is triggered as soon as the session approaches 272k tokens (sometimes even earlier), and the context never comes close to the full 1M tokens advertised.
Based on the documentation and codebase, it seems overflow/compaction is triggered using the provider/model's limit.input minus the reserved buffer. Here are my questions:
Does OpenCode actually support the new 1M-token context for GPT-�3 or GPT-5.4? Or is it possible that the provider/model metadata is still set to the legacy window size?
Is there a way to explicitly configure or pass model_context_window / model_auto_compact_token_limit (or similar params) in opencode to activate or test the real 1M window?
Are there any best practices, config tweaks, or workarounds to enable the extended context and prevent premature compaction at ~272k?
If true 1M context support is not yet possible, what is the recommended solution to make full use of the model's real window size?
Any guidance or clarification would be greatly appreciated!
Activity
github-actions commentedon Mar 6, 2026
This issue might be a duplicate of existing issues. Please check:
Please review those issues and consider adding your information there rather than opening a new one.
TomLucidor commentedon Mar 9, 2026
Similar issues here where the defaults are all wrong #16709
MartyMcFlyInTheSky commentedon Apr 21, 2026
Same here. In general options to control the context window are dearly lacking.