Session becomes unusable: Invalid input[N].id = fc_... (expected ctc) when replaying history
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.32112
What subscription do you have?
use openai api
What platform is your computer?
Microsoft Windows NT 10.0.22635.0 x64
What issue are you seeing?
Using OpenAI API to access Codex ++, the dialogue will now report this error every once in a while, resulting in the whole dialogue not being able to be used normally.
A new dialogue must be opened, but this error will also occur after a while in the new dialogue, which will make it impossible to use normally.
error example:
Invalid 'input[107].id': 'fc_08d2f9b0333b7690016a88ed74f82c87d0aa6bf2edc704ebc0'. Expected an ID that begins with 'ctc'. [trace_id=76843951e11a52345eaa4b2aba010e12]
<img width="779" height="94" alt="Image" src="https://github.com/user-attachments/assets/053ab607-3291-4110-9e69-d4a86aa21215" />
What steps can reproduce the bug?
This error occurs frequently in long sessions, but it can take a long time to open a new session.
Once this error occurs, it cannot continue and a new session must be opened.
What is the expected behavior?
_No response_
Additional information
_No response_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
我也遇见了同样的问题,而且发现它常发生在上下文自动压缩后,而且同一个会话在input后面的id一样,不同会话不一样。请官方尽快解决,已经严重影响到大型工程的完成
Invalid 'input[19].id': 'fc_0fd5308a94266ded016a896f6797d487d0a3ef0902829fe54c'. Expected an ID that begins with 'ctc'.
<img width="945" height="190" alt="Image" src="https://github.com/user-attachments/assets/9e66dd4f-d131-4be7-8e31-c381fa166850" />
me tooooooo!
错误的原因是rollout文件中出现了类似这样的记录:
但 Responses API 的 ID 规则是:
因此,custom_tool_call 搭配 fc_ 是非法组合,API 才会报:
错误发生的源头,是 Responses API 返回了错误的 ID,但是 Codex 未检查 ID 前缀是否和 item 类型匹配,并将错误的 item 写入了 rollout,当恢复会话时再次发送该历史 item,Responses API 拒绝请求。
当前源码中的缺陷在于:
我想知道如何解决这个问题,因为我用的ccswitch
我开源了修复codex会话id与服务器id不匹配导致的报错工具:
https://github.com/BingLi37/codex-fix
!image.avif