Skip to content

v0.6.2 - Egress Circuit Breaker with Alerts, Recovery from Stalled Upstream Connections, and Tool Limits Kept for Codex

Choose a tag to compare

@github-actions github-actions released this 11 Nov 16:08
· 83 commits to main since this release
5f693cb

v0.6.2 - Egress Circuit Breaker with Alerts, Recovery from Stalled Upstream Connections, and Tool Limits Kept for Codex

Nine pull requests since v0.6.1, most of them from a day of network trouble on the production host. Pair it with codeProxy v0.7.2 to see which proxies the breaker has shut. No database migrations, but tenants that already have alerting on will start receiving egress alerts. See Upgrade Notes.

Highlights

1. Egress circuit breaker

  • When a proxy rejects its credentials or cannot be reached, CliRelay stops sending requests through it instead of trying one account after another behind the same broken proxy. Those requests get an immediate 503 egress_unavailable in the client's protocol, with Retry-After, and the accounts behind the proxy are not put on cooldown. The breaker lets a real request through now and then to probe the proxy and closes once one gets through (#1282).
  • CLIRELAY_EGRESS_BREAKER=off in the node's environment file turns the breaker off at the next start.
  • A new alert rule reports a proxy that has stayed shut for for_minutes (default 3, 1–1440) after a failed probe, and reports its recovery, through the tenant's alert channels. GET /v0/management/proxy-pool/egress-status lists the proxies the breaker currently refuses, for the console (#1284).

2. Upstream connections

  • HTTP/2 connections to upstreams are now checked for liveness, and a connection that stops answering is dropped. After a network interruption, requests no longer go to connections that only send and never receive (#1281).
  • Kimi's Claude-format requests and token counts go out through the credential's proxy-pool entry or the global proxy, like its other requests. Before, they only honored a proxy URL set on the credential itself (#1283).

3. Codex

  • A Claude client's tool_choice: {"type":"none"} reaches Codex as "none", and disable_parallel_tool_use: true becomes parallel_tool_calls: false. Before, both were rewritten to allow any number of tool calls (#1285). Thanks @Android-Login-Analysis (#1042); the other routes in that report are still open.
  • Tools from Chat Completions clients reach Codex as non-strict. gpt-6-astra checked them as strict schemas and refused every turn whose tools a strict schema cannot express (#1277).
  • When the Codex upstream answers 400 with nothing but Bad Request, the shape of the refused request is recorded in the route trace for diagnosis (#1279).

4. Security

  • Built with Go 1.26.11 for GO-2026-6859 in net/http (#1278), and with golang.org/x/net v0.62.0 for GO-2026-6866 and GO-2026-6860 (#1280).

Detailed Changes

Backend CliRelay

  • fix(translator): preserve Claude no-tools and sequential restrictions for Codex (#1285)
  • feat(alerting): report proxies the egress breaker shuts, and show them in the proxy pool (#1284)
  • fix(kimi): send Claude-format requests through the credential's configured proxy (#1283)
  • fix(egress): stop sending requests through a proxy known to be failing (#1282)
  • fix(transport): drop HTTP/2 upstream connections that stop answering (#1281)
  • chore(deps): raise golang.org/x/net to v0.62.0 for GO-2026-6866 and GO-2026-6860 (#1280)
  • feat(codex): record the shape of requests the upstream refuses with an unexplained 400 (#1279)
  • build: use Go 1.26.11 for GO-2026-6859 (net/http) (#1278)
  • fix(translator): keep Chat Completions tools non-strict for Codex (#1277)

Upgrade Notes

  1. Update the panel as well. codeProxy v0.7.2 shows the breaker's state on the proxy pool page and adds the new alert rule to the alert settings.
  2. Egress alerts switch on by themselves. Alert settings saved before this release read the new rule as on, with 3 minutes, so tenants that already have alerting on will receive egress alerts after the upgrade. Switch the rule off in the alert settings if you don't want them.
  3. Requests through a broken proxy fail fast. They now get a 503 egress_unavailable at once instead of a 500 after trying several accounts. Set CLIRELAY_EGRESS_BREAKER=off in the node's environment file to keep the previous behaviour.
  4. Building from source needs Go 1.26.11, the toolchain in go.mod.
  5. There are no database migrations, and the deploy script version is unchanged.

Binaries for six platforms and the GHCR image ghcr.io/kittors/clirelay:v0.6.2 are published by the release workflows. Released together with codeProxy v0.7.2.

中文说明(点击展开)

v0.6.2 - 出口熔断与告警、上游连接卡死后自动恢复、Codex 保留工具限制

自 v0.6.1 起共 9 个 PR,大多来自生产机一天里的网络故障。请与 codeProxy v0.7.2 一起升级,才能看到哪些代理被熔断。没有数据库迁移,但已经开着告警的租户会开始收到出口告警。详见升级提示。

核心更新

1. 出口熔断

  • 代理拒绝账号密码或连不上时,CliRelay 不再经它转发,也不再在同一个坏代理后面一个账号接一个账号地试。这类请求立即收到 503 egress_unavailable(按客户端协议返回,带 Retry-After),代理后面的账号不会因此进入冷却。熔断器会不时放一个真实请求过去试探,通过就恢复(#1282)。
  • 在节点的环境变量文件里写 CLIRELAY_EGRESS_BREAKER=off,下次启动时关闭熔断。
  • 新增告警规则:代理被熔断超过 for_minutes(默认 3,范围 1–1440)且熔断后至少有一次试探失败时,经租户的告警渠道通知,恢复时也会通知。GET /v0/management/proxy-pool/egress-status 列出当前被熔断的代理,供控制台显示(#1284)。

2. 上游连接

  • 到上游的 HTTP/2 连接现在有存活检测,不再应答的连接会被丢弃。网络中断恢复后,请求不会再派到只发不收的老连接上(#1281)。
  • Kimi 的 Claude 格式请求和 token 计数现在和它的其它请求一样,经凭据的代理池条目或全局代理发出。此前只认凭据本身配置的代理地址(#1283)。

3. Codex

  • Claude 客户端的 tool_choice: {"type":"none"} 现在以 "none" 发给 Codex,disable_parallel_tool_use: true 会变成 parallel_tool_calls: false。此前两者都被改成允许任意多次工具调用(#1285)。感谢 @Android-Login-Analysis(#1042);该报告里的其它路由还未修复。
  • Chat Completions 客户端的工具以非 strict 发给 Codex。gpt-6-astra 曾把它们当 strict schema 校验,凡是 strict schema 表达不了的工具,整轮都被拒绝(#1277)。
  • Codex 上游只回一个 Bad Request 的 400 时,会在路由追踪里记下被拒请求的结构,便于排查(#1279)。

4. 安全

  • 用 Go 1.26.11 构建,修复 net/http 的 GO-2026-6859(#1278);golang.org/x/net 升到 v0.62.0,修复 GO-2026-6866 和 GO-2026-6860(#1280)。

升级提示

  1. 请同时升级面板。 codeProxy v0.7.2 在代理池页显示熔断状态,并在告警设置里加入新规则。
  2. 出口告警会自动生效。 本版之前保存的告警设置会把新规则读成开启、3 分钟,所以已经开着告警的租户升级后会收到出口告警。不需要的话,在告警设置里关掉这条规则。
  3. 经坏代理的请求会快速失败。 现在立即返回 503 egress_unavailable,不再试过几个账号后返回 500。想保留原来的行为,在节点的环境变量文件里写 CLIRELAY_EGRESS_BREAKER=off。
  4. 从源码构建需要 Go 1.26.11,即 go.mod 里的 toolchain。
  5. 没有数据库迁移,部署脚本版本没有变化。

六个平台的二进制包和 GHCR 镜像 ghcr.io/kittors/clirelay:v0.6.2 由发版工作流发布。本次与 codeProxy v0.7.2 一起发布。