我一直觉得 Codex 最近烧 Token 烧得不太对。
把本地 session 拆开一看,还真找到一个坑:最近版本新增的 JS tool,在执行异步任务时默认高频等待。任务明明还没跑完,模型却被一遍遍叫醒,Token 就这么白白烧掉了。
官方修复前,可以在全局 AGENTS.md 追加:👇
For long-running asynchronous work:
- Empty `write_stdin` polls MUST use `yield_time_ms >= 180000`;
prefer `300000` when intermediate output is not needed.
- `functions.wait` MUST use `yield_time_ms >= 180000`.
- `functions.exec` MUST set its outer `
@exec yield_time_ms` at least
30000 ms longer than the longest nested tool wait, so the outer
code cell does not yield first.
- Do not apply the long wait to non-empty `write_stdin` calls that
send interactive input.
- These tools return early when the process or cell completes.
Do not wake the model merely to report that work is still running.
新会话直接生效,老会话 compact 一次后生效。
我这边加完重新统计,Token 消耗少了大约 25%。
大家也可以让自己的 Codex 分析本地 session 验一遍。欢
迎使劲转发,把事情闹大。官方 issue backlog 堆成山,这种问题不闹大,多半连看都懒得看。