lbyxiaolizi
612436a5a7
fix(openai-compat): Responses→Chat 桥接按 reasoning item id 缓存回注 reasoning_content
修复 #5520:Codex 经 force_chat_completions 桥接到 DeepSeek thinking 上游时,
历史中的 encrypted-only reasoning item(summary 为空 + 不透明 encrypted_content,
远程 compaction / 跨会话恢复后常见)取不出明文,后续 assistant 消息缺
reasoning_content,DeepSeek 400 "The reasoning_content in the thinking mode
must be passed back to the API",客户端仅看到通用 502。
reasoning item 的 id 一定会被客户端回传,以其为 key 做服务端缓存:
- GatewayCache 新增 Set/GetReasoningContent(Redis,默认 TTL 7 天)
- 响应侧:流式扫 response.output_item.done、非流式扫 output,把 reasoning
全文按 item id 写缓存;客户端断连后 drain 期间用 detached ctx 仍会写完
- 请求侧:apicompat 新增 ResponsesToChatCompletionsRequestWithOptions 与
ReasoningContentByID 钩子,encrypted-only item 查缓存补回 pendingReasoning;
缓存 miss/出错一律 fail-open 维持原行为
- 自愈:历史里带明文 summary 的 reasoning item 顺手刷新缓存,覆盖 Redis
flush / 跨实例漂移
测试:apicompat(命中恢复/miss 保持原样/明文优先)、service 端到端(流式
写缓存、请求侧回注+自愈)、repository miniredis 存取。
2026-08-17 16:48:36 +08:00
..
2026-08-05 18:25:58 +08:00
2026-07-20 11:39:37 +08:00
2026-07-19 13:05:24 +08:00
2026-07-17 03:35:26 +00:00
2026-07-19 15:00:09 +08:00
2026-07-19 13:05:24 +08:00
2026-08-05 18:25:58 +08:00
2026-08-05 18:25:58 +08:00
2026-08-13 08:37:57 +08:00
2026-07-09 22:52:35 +08:00
2026-08-17 16:48:36 +08:00
2026-08-17 16:48:36 +08:00
2026-05-31 16:14:58 +08:00
2026-06-26 00:58:38 +08:00
2026-07-10 20:46:38 +08:00
2026-07-31 19:36:47 +08:00
2026-08-13 08:37:57 +08:00
2026-08-13 08:37:57 +08:00
2026-07-05 13:58:08 +08:00
2026-07-19 13:05:24 +08:00
2026-07-27 08:19:19 +08:00
2026-07-27 08:19:19 +08:00
2026-07-14 14:48:22 +08:00
2026-07-13 14:38:05 +08:00
2026-07-12 04:53:34 +08:00
2026-07-10 17:38:17 +08:00
2026-06-03 17:26:05 +08:00
2026-07-09 15:34:10 +08:00
2026-08-07 23:09:03 +08:00
2026-07-15 00:59:28 +08:00
2026-07-15 14:31:26 +08:00
2026-08-07 23:09:03 +08:00
2026-07-27 08:19:19 +08:00
2026-07-27 08:19:19 +08:00
2026-07-20 11:39:37 +08:00
2026-06-06 00:59:27 +08:00
2026-07-13 12:08:32 +08:00
2026-07-15 14:31:26 +08:00
2026-08-13 08:37:57 +08:00