Skip to content

fix(openai): replay reasoning items with only the fields Codex sends - #193

Merged
Slacker-LLC merged 1 commit into
mainfrom
fix/reasoning-replay-fields
Oct 10, 2026
Merged

Slacker-LLC merged 1 commit into
mainfrom
fix/reasoning-replay-fields

Conversation

@Slacker-LLC

Copy link
Copy Markdown
Owner

做了什么

重放 reasoning 输出条目时,只发官方 Codex 会发的字段:id、summary(缺省 [])、content(含 reasoning_text 时省略)、encrypted_content。此前是把后端返回的原始对象整个塞回 input。其他类型的条目原样透传。

依据

官方 Codex 经类型化结构体重新序列化 reasoning 条目(codex-rs/protocol ResponseItem::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

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
@Slacker-LLC
Slacker-LLC merged commit b153411 into main Oct 10, 2026
14 checks passed
@Slacker-LLC
Slacker-LLC deleted the fix/reasoning-replay-fields branch October 10, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants