codex会根据provider name是不是OpenAI来进行本地compact或者remote compact
codex的远程compact会比一般的本地compact效果好一些,走的是openai的官方请求,原生压缩,本地compact就是使用提示词进行本地compact
远程compact走的是/v1/responses/compact端点,本地compact走的就直接是/v1/responses端点。local compact有可能会在compact的时候显示warning,说“Heads up: Long threads and multiple compactions can cause the model to be less accurate. Start a new thread when possible to keep threads small and targeted.”,remote compact不会 ![]()
之前有在站内看到过开启方法,最近折腾了一下发现,现在需要把所有的model_provider都改成OpenAI才行:
model_provider = "OpenAI"
...
[model_providers.OpenAI]
name = "OpenAI"
试了一下,crs反正是没问题的,可以看到请求了这个端点:
11:59:47 Selected OpenAI account: xxx
11:59:54 🟢 200 POST /openai/v1/responses/compact 7319ms 0B
原理的话,知乎上好像有篇文章(不过看着是gpt润色的…)
https://zhuanlan.zhihu.com/p/2019807681553146393



