Repository navigation
Conversation
The Codex backend shares the Responses reasoning dialect with every compatible endpoint, but it accepts only the rs_ item ids it issued. A conversation that switched to Codex from a relay replayed the relay's own item ids (UUIDs, from metadata or the block id fallback), and the backend rejected every following request with "Expected an ID that begins with 'rs'". Such items are now dropped, summary and encrypted content with them, while issued items still replay. Linear: TWI-21
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.
Author
Agent
Type
Description
Codex 后端与公开 Responses API 共用 reasoning dialect,但它只接受自己签发的
rs_item id。会话先经 Responses 兼容的 relay(如经 relay 的 DeepSeek)产生 reasoning,再切到 Codex 时,converter 会把 relay 的 item id(UUID,来自 metadata,或回退到 block id)原样回放,后端对之后的每个请求都返回:Memoh 生产 2026-10-28 共 53 个 run 因此失败,其中一个 session 连续失败 44 次(Linear TWI-21 / MEMOH-246)。
现在 Codex converter 解析出的 item id 不以
rs_开头时,丢弃整个 reasoning item,包括 summary 和 encrypted content;同一消息中由后端签发的 item 照常回放、合并。通用 Responses converter 不加这项校验:它可能连的是 relay,把 relay 自己的 id 回放给同一个 relay 是合法的。调查后没有在 Responses/Codex 加
SameReasoningModel守卫:ReasoningPart.Model记录的是响应报告的模型名,relay 会把它改写成渠道的真实上游模型名,OpenAI 也会返回带日期的快照名,与请求的模型名比较会让同一模型每一步都丢掉 reasoning。模型与端点的归属由调用方用自己的稳定身份判断(Memoh 侧另行修复)。Verification
mise run ci:build、vet、lint(0 issues)和完整 short test suite 通过。provider/openai/codex/reasoning_replay_test.go:已签发 item 合并回放并保留 encrypted content;relay 的 UUID(在 metadata 中、或仅作为 block id)和空 id 被跳过且 assistant 文本照常发送;同一消息中外来 item 与已签发 item 并存时只回放后者。不含本修复时这些用例失败。