Repository navigation
Conversation
SsuJojo
force-pushed
the
fix/responses-reasoning-item-id
branch
from
October 24, 2026 12:28
48798e1 to
2a7886f
Compare
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.
问题 / Problem
127.0.0.1:3065是 Agent2API;test-cp通过自定义 provider 再转发到 Codex Proxy。上游以store:false返回 reasoning 项时,id与encrypted_content是一组连续性凭据。Agent2API 原先只保留了encrypted_content,请求和流式回程都会丢弃或重新生成rs_*id,因此下一轮会得到Item with id ... not found。Port 3065 is Agent2API, which forwards
test-cpthrough the Codex Proxy. Withstore:false, a reasoning item'sidandencrypted_contentmust remain paired. Agent2API previously retained onlyencrypted_contentand regenerated or dropped thers_*id in both translation directions, causing the next request to fail withItem with id ... not found.修改 / Changes
在内部 Chat 消息上同时暂存 reasoning item id 与 encrypted content,并在 Responses 出站请求中原样恢复。
捕获 Codex Proxy SSE 中 reasoning 项的 id 和 encrypted content,回传给客户端。
流式 Responses 输出与聚合输出都复用上游 id,只有缺失时才生成随机 id。
继续使用
_wb_内部字段前缀,普通 Chat 上游发送前仍会统一剥离。Preserve the reasoning item id together with
encrypted_contentacross Responses to Chat conversion and restore both on upstream requests.Capture reasoning ids and encrypted continuity payloads from Codex Proxy SSE and return them to the client.
Reuse upstream ids in streaming and aggregated Responses output; generate a fallback id only when none exists.
Keep the
_wb_isolation so internal fields are still stripped before plain Chat upstreams.验证 / Verification
cargo check -p agent2api-serverpassed (one pre-existing deprecation warning incloud_sync/auto_sync.rs).git diff --checkpassed.🤖 本条回复由 AI Agent 生成
Generated by an AI agent.