Codex 降智?我用一个短补丁让它重新认真思考

950 字
5 分钟
Codex 降智?我用一个短补丁让它重新认真思考

Codex reasoning patch 测试结果
Codex reasoning patch 测试结果

最近用 Codex 的时候,我明显感觉它有点“降智”。

同样的问题,有时候它能认真推理,把过程走完;有时候却很快结束,答案看起来像是没想完就交卷了。

一开始我以为是模型本身变差了。后来参考了这个 issue 的讨论:

https://github.com/haowang02/codex-candy-eval/issues/10

再用 codex-candy-eval 测了一下,发现问题可能和 Codex 的系统提示词、进度汇报、配置噪声有关。

感谢这个 issue 里作者和评论区提供的测试思路。

我的测试结果#

测试命令:

Terminal window
python codex_candy_eval.py -m gpt-5.5 -r high -n 5

我的结果是:

修改前:1/5,20%
只加短补丁:3/5,60%

后来我继续清理了本地的 skill、插件和 AGENTS.md 噪声,最高跑到过:

5/5,100%

不过后面这部分和每个人本地环境关系比较大,所以这篇先讲最简单、最容易回滚的方案:加一个短补丁文件

核心思路#

不要一上来就复制一大段系统提示词,也不要直接往 AGENTS.md 里塞很多临时规则。

我更推荐新建一个单独的补丁文件,然后通过 model_instructions_file 引入。

这样有几个好处:

  • 不污染原来的 AGENTS.md
  • 方便回滚
  • 方便单独测试效果
  • 不会额外塞一大堆无关上下文

修改前先备份#

Linux / macOS:

Terminal window
cp ~/.codex/config.toml ~/.codex/config.toml.before

Windows PowerShell:

Terminal window
Copy-Item "$env:USERPROFILE\.codex\config.toml" "$env:USERPROFILE\.codex\config.toml.before" -Force

第一步:新建补丁文件#

Windows 路径示例:

C:\Users\Administrator\.codex\instructions\codex-reasoning-patch.md

Linux 路径示例:

~/.codex/instructions/codex-reasoning-patch.md

macOS 路径示例:

/Users/你的用户名/.codex/instructions/codex-reasoning-patch.md

文件内容如下:

For difficult coding, debugging, configuration, and reasoning tasks, prioritize completing the reasoning and verification loop before producing a final answer.
Do not shorten analysis or stop early merely to provide optional progress updates.
Progress updates should be brief and useful, but they must not interrupt deep reasoning, tool-based verification, or task completion.

这段内容的意思很简单:

让 Codex 在复杂任务里优先完成推理和验证,不要为了可选的进度汇报提前打断思考。

第二步:修改 config.toml#

打开:

~/.codex/config.toml

加入 model_instructions_file

Windows 示例:

model_instructions_file = 'C:\Users\Administrator\.codex\instructions\codex-reasoning-patch.md'

Linux 示例:

model_instructions_file = "/home/你的用户名/.codex/instructions/codex-reasoning-patch.md"

macOS 示例:

model_instructions_file = "/Users/你的用户名/.codex/instructions/codex-reasoning-patch.md"

保存后重启 Codex,再重新测试。

第三步:重新测试#

还是用同一个命令:

Terminal window
python codex_candy_eval.py -m gpt-5.5 -r high -n 5

我这边只加短补丁后,从:

1/5,20%

提升到了:

3/5,60%

这说明短补丁确实有帮助,但也不是万能药。

如果还不稳定怎么办?#

如果加了短补丁之后还是不稳定,可以继续检查本地配置噪声。

我这里后续又清理了这些东西:

1. 修复 SKILL.md 的 UTF-8 BOM
2. 清理 config.toml 里过期的 .codex/.tmp 插件路径
3. 禁用已经不存在的插件
4. 禁用重复插件
5. 禁用当前缺 token、一直报错的插件
6. 压缩过长、重复的 AGENTS.md

这些东西不一定单独导致 Codex 变笨,但会让 Codex 启动时加载很多无关上下文和错误信息。

我的体感是:上下文越干净,Codex 越容易把推理预算用在真正的问题上。

如何回滚?#

如果效果不好,直接删掉或注释这一行:

model_instructions_file = "..."

然后恢复之前备份的配置也可以。

Linux / macOS:

Terminal window
cp ~/.codex/config.toml.before ~/.codex/config.toml

Windows PowerShell:

Terminal window
Copy-Item "$env:USERPROFILE\.codex\config.toml.before" "$env:USERPROFILE\.codex\config.toml" -Force

总结#

这次我的结论是:

Codex 变笨,不一定完全是模型本身的问题,也可能是本地提示词、插件、skill、AGENTS.md 等上下文太乱,导致它没把推理预算用在真正的问题上。

我的建议是:

先加短补丁
再跑测试
如果还有问题,再清理本地配置噪声

这套方法不保证每个人都能复现同样结果,但我这里确实有明显提升。

再次感谢这个 issue 提供的思路和测试方向:

https://github.com/haowang02/codex-candy-eval/issues/10

支持与分享

如果这篇文章对你有帮助,欢迎分享给更多人或赞助支持!

赞助

评论区

Profile Image of the Author
一万AI分享
技术教程与资源分享
公告
从云端部署到家庭网络,从软件工具到智能硬件。 我会持续更新内容,希望能和大家一起 成长、分享、交流。
音乐
封面

音乐

暂未播放

0:00 0:00
暂无歌词
分类
标签
站点统计
文章
42
分类
7
标签
137
总字数
60,247
运行时长
0
最后活动
0 天前

目录