开启百万 Token 上下文
Enable 1M Context in Codex
要点
- 在 ~/.codex/config.toml 顶层写入 model、窗口大小和自动压缩阈值。
- 百万窗口配 90 万压缩点,给摘要留余量;改完重启客户端并开新会话。
- 单次试用不必改默认,用 CLI 的 -c 传入窗口和压缩阈值即可。
- 官方默认窗口已按效果和成本调过,大多数任务不必开 1M。
原帖开头
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 m …






