Skip to content

v0.6.3 - Codex History and Claude Cache Fixes

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Nov 06:12
6c35878

v0.6.3 - Codex History and Claude Cache Fixes

Fixes two request-body errors that can stop an existing conversation: nonempty reasoning.content replayed to OpenAI, and Claude requests with more than four cache breakpoints. This release also includes the Responses, stream accounting and shutdown fixes merged since v0.6.2. Continue using codeProxy v0.7.2; the panel has no code changes in this release.

Highlights

1. Conversations that were refused with 400

  • Before sending history to an official OpenAI or ChatGPT endpoint, CliRelay removes nonempty reasoning.content arrays that the destination refuses, while keeping summaries, valid ciphertext, message content and tool results; all affected history items are handled before the first request, across HTTP, compact and WebSocket calls (#1294).
  • Claude requests are limited to four cache breakpoints at the actual send boundary, including top-level automatic caching, token counts and retries; when the gateway's identity marker would make a legal client request exceed the limit, that marker is removed first (#1294).

2. Responses history and streaming

  • Responses reasoning summaries survive conversion to Chat Completions and the merging of parallel tool-call history; streamed reasoning and message items keep their identities and output indexes (#1291).
  • Responses SSE handling preserves complete event boundaries and fragmented data fields, including the first event, rather than losing or misdispatching an event split across network reads (#1291).

3. Usage and shutdown

  • A valid completed or incomplete Codex reply remains successful if the connection closes during cleanup, while an explicit upstream error still wins; terminal usage is settled after stream cleanup (#1291).
  • Database shutdown waits for admitted usage publications and queued callbacks before closing the store, and database metadata stays attached to the correct handle while writes finish (#1291).

4. Compatible upstreams

  • Ollama native chat preserves thinking content in responses, streams and replayed history, and Claude stop-sequence arrays remain arrays when translated to Chat Completions (#1291).

Detailed Changes

Backend CliRelay

  • fix(executor): prevent reasoning-history and cache-breakpoint 400s (#1294).
  • fix(reasoning): preserve every readable summary when tool-call history is merged (#1291).
  • fix(responses): keep reasoning history, stream item identity and complete SSE frames (#1291).
  • fix(codex): settle terminal usage after cleanup and preserve valid replies through transport closure (#1291).
  • fix(usage): drain publications before database close and retain handle-specific metadata (#1291).
  • fix(ollama): preserve native thinking content (#1291).
  • fix(translator): preserve Claude stop-sequence arrays (#1291).

Upgrade Notes

  1. No panel update is needed. codeProxy v0.7.2 remains the matching release; its source tree is unchanged.
  2. Existing sessions do not need their local files edited. Histories sent through CliRelay to the official destinations are normalized before forwarding; custom compatible upstreams keep their own reasoning-content format.
  3. Client cache settings are preserved within the four-slot limit. Requests that already exceed the limit lose the gateway identity marker first, then older message anchors, tool anchors and system anchors as needed; message text and tool results are retained.
  4. There are no database migrations or deployment-script changes in this release. Source builds use the existing Go 1.26.11 toolchain.
  5. Regression tests reproduce both original 400s on the old implementation and pass after the fix, including a history with 150 incompatible reasoning items; full local CI and all PR checks passed before merging.

Release workflows publish binaries for six platforms, checksums.txt, and the GHCR image ghcr.io/kittors/clirelay:v0.6.3.

中文说明(点击展开)

v0.6.3 - 修复 Codex 历史重放和 Claude 缓存超限

修复两类会让已有会话无法继续的请求错误:向 OpenAI 重放非空 reasoning.content,以及 Claude 缓存断点超过四个。同时包含 v0.6.2 之后已合入的 Responses、流式计费和关停修复。面板继续使用 codeProxy v0.7.2,本轮前端代码没有变化。

核心更新

1. 会话请求被拒绝,返回 400

  • 向官方 OpenAI 或 ChatGPT 接口发送历史前,清理目标不接受的非空 reasoning.content 数组,保留摘要、有效密文、消息正文和工具结果;首次发送前一次处理全部相关历史,覆盖 HTTP、compact 和 WebSocket(#1294)。
  • Claude 在实际发送时统一限制最多四个缓存断点,计入顶层自动缓存,并覆盖 token 计数和重试;如果网关的身份标记会让客户端原本合法的请求超限,优先移除该标记(#1294)。

2. Responses 历史和流式响应

  • Responses 推理摘要转为 Chat Completions、或合并并行工具调用历史时不再丢失;流式推理和消息项保留各自的标识及输出索引(#1291)。
  • SSE 处理保留完整事件边界和分段的数据字段,包括第一个事件,避免事件被网络读取拆开后丢失或分发错误(#1291)。

3. 用量记录和关停

  • Codex 已返回有效的完成或未完成响应后,清理连接时断开不会再把成功请求误记成失败;上游明确报错时仍按失败处理,用量在流式清理后结算(#1291)。
  • 数据库关闭前等待已接收的用量发布和排队回调完成,写入结束前,数据库元数据始终对应原来的连接句柄(#1291)。

4. 兼容上游

  • Ollama 原生聊天的普通响应、流式响应和历史重放保留思考内容;Claude 的停止序列数组转为 Chat Completions 时仍保持数组(#1291)。

升级提示

  1. 无需升级面板。 配套版本仍为 codeProxy v0.7.2,前端代码树没有变化。
  2. 无需手工编辑已有会话文件。 经 CliRelay 发往官方目标的历史会在转发前规范化;自定义兼容上游继续保留自身的推理内容格式。
  3. 客户端缓存设置在四个名额内保持原样。 请求本身已经超限时,先移除网关身份标记,再按需移除较早的消息断点、工具断点和 system 断点,保留消息正文和工具结果。
  4. 本版没有数据库迁移或部署脚本变更,从源码构建继续使用 Go 1.26.11。
  5. 回归测试已验证旧实现出现两类原始 400、修复后通过,包含 150 个不兼容推理项的长历史;完整本地 CI 和全部 PR 检查均已通过。

发版工作流发布六个平台的二进制包、checksums.txt,以及 GHCR 镜像 ghcr.io/kittors/clirelay:v0.6.3。