Codex 开启 1M 上下文:修改 config.toml 即可
Tibo 教你在 Codex 里改两行配置就能让 GPT-5.6 Sol 记住 100 万 token,嫌默认不够用可以试试。
Tibo 分享了在 Codex 中为 GPT-5.6 Sol 开启 1M token 上下文窗口的方法。
只需在 ~/.codex/config.
toml 中设置 model_context_window 为 1000000,并将自动压缩阈值设为 900000。也可以通过命令行参数为单次会话启用。
OpenAI 表示默认设置已针对性能和成本调优,但此配置可满足更长上下文需求。
Tibo 分享了 Codex 开启 1M 上下文的方法。不过我不是很有动力去修改,感觉当前还挺流畅的,我相信他们已经针对这个上下文调优过,只要压缩得当,上下文短一些性能会更好也更便宜。 具体方法很简单,只要在 ~/.codex/config.toml 中设置: ``` model = "gpt-5.6-sol" model_context_window = 1000000 model_auto_compact_token_limit = 900000 ``` 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: ``` model = "gpt-5.6-sol" model_context_window = 1000000 model_auto_compact_token_limit = 900000 ``` 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: ``` codex -m gpt-5.6-sol \ -c model_context_window=1000000 \ -c model_auto_compact_token_limit=900000 ``` Have fun, but also know that we tuned the default carefully! 🔗 View Quoted Tweet📊 5 ⚡
本条情报归属 AITOP「技巧」核心追踪栏目。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:Codex、GPT-5.6 Sol、上下文窗口、配置技巧,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始线索采编自「宝玉」(@dotey),经 AITOP 多维评分管线结构化提炼。截至目前,全网已有 10 家独立信源对该事件进行交叉印证与跟进报道(含 小互、IT之家、NVIDIA AI 等),属于近期高关注度行业信号。