Tibo 分享了 Codex 开启 1M 上下文的方法。不过我不是很有动力去修改,感觉当前还挺流畅的,我相信他们已经针对这个上下文调优过,
只要压缩得当,上下文短一些性能会更好也更便宜。
具体方法很简单,只要在 ~/.codex/config.toml 中设置:
Tibo (@thsottiaux)
Here is how to enable a 1M-token context window in Codex for GPT-5.6 Sol.
Even though we have tuned the context limit in Codex to be set optimally when it comes to performance and cost, this is a common ask, so here it is documented.
A larger context window lets Codex retain more code, tool output, and conversation history before summarizing older material. You need a model that supports it. And GPT-5.6 Sol, for example, has a documented 1,050,000-token window.
Open ~/.codex/config.toml and add or update these settings at the top level, before any [section] headers:
The first setting selects the model. The second tells Codex to use a one-million-token context budget. The third starts automatic history compaction around 900,000 tokens, leaving some headroom. Restart Codex client and start a new session after saving.
To try the configuration for a single CLI session without changing your defaults:
Have fun, but also know that we tuned the default carefully!
评论
?
参与讨论