Skip to content

v0.6.1 - Quota Window Spend, Grok Tools for Codex, Antigravity Project Discovery, and Faster Codex Requests

Choose a tag to compare

@github-actions github-actions released this 10 Nov 17:02
· 107 commits to main since this release
8d8ba07

v0.6.1 - Quota Window Spend, Grok Tools for Codex, Antigravity Project Discovery, and Faster Codex Requests

33 pull requests since v0.6.0, ten of them from the community. Pair it with codeProxy v0.7.1 to see what each quota window has cost. Two PostgreSQL migrations run at startup, and self-hosted two-slot deployments must update their root-managed deploy scripts. See Upgrade Notes.

Highlights

1. Quota window spend

  • Every quota window an account reports (5 hours, 7 days, the Claude Opus week, Gemini and Antigravity buckets) now carries what that account has spent in it so far, from CliRelay's own usage log. The status response declares quota-window-spend (#1261). Thanks @StarYunLee for the request (#1103).
  • Z.ai and BigModel Coding Plan accounts report their plan and their five-hour and weekly quotas (#1234, @ai-babai).

2. Grok and xAI

  • Codex Desktop's namespace tools are flattened into tools Grok accepts, and the calls are mapped back, so Codex through Grok no longer gets a 422 (#1258). Tool schemas whose root is a union of object branches are sent in a form Grok accepts (#1262). Thanks @Transparent0 (#696).
  • One coherent Grok client identity is learned and sent, instead of a mix of fields from several requests. The default is the stable CLI, grok-shell/1.0.77, which ends the 426 "CLI version is outdated" errors (#1252). Thanks @spock-wen (#1123).
  • xAI, Kimi and iFlow tokens are refreshed through the account's own proxy, on the request path (#1251) and in the management API (#1181, @specetator). Thanks @spock-wen (#1122).

3. Antigravity

  • An account without a stored project discovers its real project and keeps it. Before, CliRelay sent a random project name, which Google answered with a misleading 403 SUBSCRIPTION_REQUIRED (#1265). Thanks @projectkite (#1032).
  • Requests present as the Antigravity Hub client, the identity Google serves Gemini 4 Argon to (#1268, @purrtado).

4. Protocol fixes

  • Claude through OpenAI Responses: text deltas carry the right output_index after a thinking block, an image sent without text no longer fails, and cached prompt tokens count in input_tokens (#1256). Thanks @RUIIIOVO (#1167, #1166, #1163).
  • Claude through Chat Completions: tool-call arguments stream as they arrive, and long histories are built without copying the request for every message (#1257). Thanks @Platinum-Scripts (#1177, #1179).
  • Gemini through OpenAI Responses: turns end as their finishReason says. MAX_TOKENS, safety stops and malformed function calls are reported as response.incomplete instead of a normal completion (#1259). Thanks @RUIIIOVO (#1144).
  • Claude:
  • Codex:
    • the image display fallback is its own SSE event (#1225, @zhaojun1998; hardened in #1226);
    • the image bridge leaves Codex's helper threads alone and respects the client's tool_choice (#1238, @zhaojun1998);
    • a Responses WebSocket session releases its pinned credential when the model switches (#1162, @RUIIIOVO).

5. Performance

  • Under heavy Codex traffic most CPU goes to large request bodies.
    • Secret masking finds the masked fields in one walk of the request (#1269).
    • Chat Completions content for Codex is built in one buffer and read in one walk (#1270, #1273). In production profiles this took the translator from about a quarter of CPU to under a tenth.
  • The request-log body purge only visits rows that may still hold bodies (#1272), and request-log maintenance now really runs on its schedule (#1274).

6. Security and masking

  • Request bodies that two JSON parsers would read differently, such as duplicate keys or non-standard JSON, are refused with 400 on the inference entry points (#1267).
  • Masking changes (#1260):
    • if the masking settings can't be read, the last settings read stay in force, instead of masking switching off;
    • tool data and tool descriptions are masked;
    • a newly shared account is hidden at once.
  • Structured-output schema descriptions are masked as well (#1263).
  • Responses WebSocket messages are bounded after decompression, not only on the wire (#1243).

7. Operations

  • Model and settlement admission no longer race, so concurrent requests can't overshoot a key's budgets (#1250).
  • An old slot's shutdown is no longer held up by the request-log purge (#1266). The deploy also leaves a retiring slot time to finish its shutdown after the drain (#1271).
  • A subscription's derived expiry is clamped to the end of the month (#1191, @specetator).

Detailed Changes

Backend CliRelay

  • feat(ai-accounts): show what each quota window has cost so far (#1261)
  • feat(ai-accounts): probe Z.ai Coding Plan quotas (#1234)
  • fix(xai): flatten Codex namespace tools for Grok and map calls back (#1258)
  • fix(xai): send Grok root tool unions whose branches are all objects (#1262)
  • fix(xai): learn and send one Grok client identity, not a mix of several (#1252)
  • fix(auth): refresh xAI, Kimi and iFlow through the account's proxy, and say why a login could not start (#1251)
  • fix(apitools): honor proxy IDs when refreshing xAI tokens (#1181)
  • fix(antigravity): discover and keep the account's project instead of inventing one (#1265)
  • fix(antigravity): present as the Hub client so Gemini 4 Argon is served (#1268)
  • fix(translator): Claude Responses text delta index, empty text blocks and cached usage (#1256)
  • fix(translator): stream Claude tool-call arguments in Chat and build message arrays once (#1257)
  • fix(translator): end Gemini Responses turns as their finishReason says (#1259)
  • fix(claude): keep auto prompt caching when the identity fingerprint is on (#1164)
  • fix(claude): drop metadata from count_tokens requests (#1187)
  • fix(claude): ignore learned fingerprints below the version gate, and load stored records on a cold cache (#1188)
  • fix(codex): emit the image display fallback as its own SSE event (#1225), and harden its SSE boundaries (#1226)
  • fix(codex): keep the image bridge off Codex helper threads and respect the client's tool_choice (#1238)
  • fix(responses-ws): release the pinned credential when the model switches (#1162)
  • fix(responses-ws): bound decompressed client messages (#1243)
  • fix(security): refuse request bodies that parsers read differently (#1267)
  • fix(masking): keep unknown settings unknown, mask tool data and descriptions, and hide shared accounts at once (#1260)
  • fix(masking): mask the descriptions in structured-output schemas (#1263)
  • perf(masking): find the fields of masked strings in one walk of the request (#1269)
  • perf(translator): build Chat Completions content for Codex in one buffer (#1270)
  • perf(translator): read Chat Completions members in one walk for Codex (#1273)
  • perf(usage): purge only request log rows that may still hold bodies (#1272)
  • fix(usage): run request log maintenance on schedule despite wakeups (#1274)
  • fix(usage): let shutdown cancel the request log body purge (#1266)
  • fix(quota): close model and settlement admission races (#1250)
  • fix(deploy): leave the retiring slot time to finish its shutdown after the drain (#1271)
  • fix(authfiles): clamp derived subscription expiration to month end (#1191)
  • fix: end the jobsnapshot heartbeat flake and the OAuth session store race under -race (#1264)

Upgrade Notes

  1. Update the panel as well. codeProxy v0.7.1 shows the quota window spend, and it only does so on backends that declare quota-window-spend.
  2. Two PostgreSQL migrations run at startup. They add a column to request_log_content, a partial index on request_log_content and an index on usage_rollup_buckets. Each index build blocks writes to its table while it runs. On production-sized tables (tens of thousands of rows) that took well under a second, and usage writes are queued rather than dropped.
  3. Stricter request bodies. Inference requests whose JSON has duplicate keys or non-standard values (such as NaN) now get a 400 instead of being passed on. Well-formed clients are not affected.
  4. Antigravity. Requests present as the Antigravity Hub client. An account without a stored project discovers its project on first use; if discovery fails, the request fails with that error instead of going out with a random project name.
  5. Two-slot deployments using scripts/deploy-blue-green.sh. The deploy script version is now 2026.11.10.1. Sync the root-managed copies on every node before the next deploy, or the workflow's version check stops the deploy.

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

中文说明(点击展开)

v0.6.1 - 额度窗口金额、Codex 经 Grok 的工具、Antigravity 项目发现与更快的 Codex 请求

自 v0.6.0 起共 33 个 PR,其中 10 个来自社区。请与 codeProxy v0.7.1 一起升级,才能看到每个额度窗口花了多少钱。启动时会跑两个 PostgreSQL 迁移;自建双 slot 部署要更新 root 管理的部署脚本。详见升级提示。

核心更新

1. 额度窗口金额

  • 账号报出的每个额度窗口(5 小时、7 天、Claude Opus 周额度、Gemini 与 Antigravity 分桶)都带上了该账号在窗口内已经花掉的金额,按 CliRelay 自己的用量日志计算;状态接口声明 quota-window-spend(#1261)。感谢 @StarYunLee 的需求(#1103)。
  • Z.ai 与智谱 BigModel 编程套餐账号会报出套餐、5 小时与每周额度(#1234,@ai-babai)。

2. Grok 与 xAI

  • Codex Desktop 的 namespace 工具会拍平成 Grok 接受的工具,调用再映射回去,Codex 经 Grok 不再报 422(#1258);根是多个 object 分支联合的工具参数也改成 Grok 接受的形式(#1262)。感谢 @Transparent0(#696)。
  • 学习并发送一套完整一致的 Grok 客户端身份,不再拼凑多个请求的字段;默认值是稳定版 CLI grok-shell/1.0.77,不再出现 426「CLI 版本过旧」(#1252)。感谢 @spock-wen(#1123)。
  • xAI、Kimi、iFlow 的 token 刷新走账号自己的代理,请求路径(#1251)和管理接口(#1181,@specetator)都已修正。感谢 @spock-wen(#1122)。

3. Antigravity

  • 没有保存项目的账号会发现并保存真实项目,不再随机编一个项目名;以前 Google 会因此回误导性的 403 SUBSCRIPTION_REQUIRED(#1265)。感谢 @projectkite(#1032)。
  • 请求以 Antigravity Hub 客户端身份发出,Google 只对这个身份提供 Gemini 4 Argon(#1268,@purrtado)。

4. 协议修复

  • Claude 经 OpenAI Responses:thinking 块之后的文字增量带上正确的 output_index;只发图片不带文字不再失败;缓存命中的 prompt 计入 input_tokens(#1256)。感谢 @RUIIIOVO(#1167、#1166、#1163)。
  • Claude 经 Chat Completions:工具调用参数随到随发;长对话不再每追加一条消息就复制整个请求(#1257)。感谢 @Platinum-Scripts(#1177、#1179)。
  • Gemini 经 OpenAI Responses:按 finishReason 收尾,MAX_TOKENS、安全拦截和格式错误的函数调用报为 response.incomplete,不再当作正常完成(#1259)。感谢 @RUIIIOVO(#1144)。
  • Claude:
  • Codex:
    • 生图结果的兜底展示作为独立的 SSE 事件发出(#1225,@zhaojun1998;#1226 加固);
    • 生图桥不再碰 Codex 自己的辅助线程,并尊重客户端的 tool_choice(#1238,@zhaojun1998);
    • Responses WebSocket 会话切换模型时会释放固定的凭据(#1162,@RUIIIOVO)。

5. 性能

  • Codex 流量大时,CPU 主要花在大请求体上。
    • 密钥脱敏只遍历一次请求就找出所有要遮的字段(#1269)。
    • 发往 Codex 的 Chat Completions 内容用一个缓冲区拼成,并且只遍历一次(#1270、#1273)。线上剖析显示,翻译器的 CPU 占比从约四分之一降到不足十分之一。
  • 请求日志正文清除只处理可能还存着正文的行(#1272),请求日志的周期维护也真正按时运行了(#1274)。

6. 安全与脱敏

  • 两种 JSON 解析器会读出不同结果的请求体(重复键、非标准 JSON 等),在推理入口一律回 400(#1267)。
  • 脱敏改动(#1260):
    • 读不到脱敏设置时沿用上次读到的设置,不再当作关闭;
    • 工具数据和工具描述也会被遮;
    • 新共享的账号立即隐藏。
  • 结构化输出 schema 的描述也会被遮(#1263)。
  • Responses WebSocket 消息在解压后也有大小上限,不只限制线上传输的大小(#1243)。

7. 运维

  • 模型准入与结算准入不再有竞态,并发请求不会超出 Key 的预算(#1250)。
  • 旧 slot 关停不再被请求日志清除卡住(#1266);部署会在排空后给退役的 slot 留出关停时间(#1271)。
  • 推算出的订阅到期日会截到当月月底(#1191,@specetator)。

升级提示

  1. 请同时升级面板。 codeProxy v0.7.1 显示额度窗口金额,而且只在声明了 quota-window-spend 的后端上显示。
  2. 启动时会跑两个 PostgreSQL 迁移:给 request_log_content 加一列,并在 request_log_content 和 usage_rollup_buckets 上各建一个索引。建索引期间会阻塞对应表的写入;生产规模(几万行)下不到一秒,期间用量写入会排队而不是丢弃。
  3. 请求体校验更严格。 JSON 里有重复键或非标准值(如 NaN)的推理请求现在回 400,不再原样转发;格式正确的客户端不受影响。
  4. Antigravity。 请求以 Hub 客户端身份发出;没有保存项目的账号会在第一次使用时发现项目,发现失败时请求直接带着这个错误失败,不再用随机项目名发出去。
  5. 使用 scripts/deploy-blue-green.sh 的双 slot 部署: 部署脚本版本升到 2026.11.10.1。下次部署前,请在每个节点上同步 root 管理的脚本,否则工作流的版本校验会中止部署。

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