Repository navigation
fix(openai): replay reasoning items with only the fields Codex sends - #193
Merged
Merged
Conversation
Captured reasoning output items were replayed to /responses as the raw backend object. Official Codex re-serializes them through a typed struct (id, summary, content, encrypted_content; content omitted when it holds reasoning_text), so backend-only fields never go back. Do the same; other item types are untouched. Unverified: suspected cause of "400 Unknown parameter" on an old conversation. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
重放
reasoning输出条目时,只发官方 Codex 会发的字段:id、summary(缺省[])、content(含reasoning_text时省略)、encrypted_content。此前是把后端返回的原始对象整个塞回input。其他类型的条目原样透传。依据
官方 Codex 经类型化结构体重新序列化 reasoning 条目(
codex-rs/protocolResponseItem::Reasoning),后端输出里的多余字段不会回传。未验证
这是对
400 Unknown parameter: '…'(只在旧会话复现、新会话正常)的怀疑,不是已证实的根因:完整报错文本尚未拿到(#188 的可展开横幅发布后可见)。本 PR 本身是与官方行为对齐,独立成立。测试
ResponsesReplayItemTest(5):多余字段/status被丢、summary 缺省、reasoning_text内容被丢、普通 content 保留、非 reasoning 条目透传(负向)。ResponsesOpaqueItemReplayTest仍通过。Co-Authored-By: Claude Sonnet 5.5 [email protected]
🤖 Generated with Claude Code
https://claude.ai/code/session_01PV4ECd3Yzu9k81sw7vHjS3
Generated by Claude Code