Repository navigation
v0.7.0 - Portal Self-Service Billing, Unified Structured Errors, and Codex/OAuth Hardening
Latestv0.7.0 - Portal Self-Service Billing, Unified Structured Errors, and Codex/OAuth Hardening
21 pull requests since v0.6.5. Pair with codeProxy v0.8.0: the panel and GHCR container image ship together with portal billing, structured error diagnostics, and guided Codex re-authorization.
Highlights
1. Portal Self-Service Billing & XunhuPay Integration
- Added self-service portal billing backed by XunhuPay and direct per-key QR payment links, plus key-scoped billing overview, checkout, and order history APIs for
/apikey-usage(#1337, #1339). - Added flexible subscription expiry adjustments with cluster config sync and backdated manual orders (#1338), plus a paginated, searchable billing targets endpoint for large tenant lists (#1357).
- Hardened XunhuPay callback/query handling for numeric
openidvalues andtotal_amount, and stopped Cloudflare 502 HTML pages from masking payment status (#1340).
2. Unified Structured Actionable Errors
- Introduced a unified structured actionable error model with strict sanitization so clients and the console receive clean, consistent error codes and remediation hints without leaking upstream internals (#1352).
- Added a dedicated Codex
reset-creditmanagement endpoint and standardized frontend error responses (#1343).
3. Codex OAuth, TLS Fingerprint, Re-authorization & Stream Stability Hardening
- Hardened Codex OAuth refresh and re-authorization across the whole lifecycle: aligned official JSON refresh payloads, synchronized
reauth_requiredacross cluster nodes, enforced fail-closed proxy binding during re-auth, deduplicated concurrent reauths, unified TLS fingerprints and client identity across probe/reauth planes, and flagged cross-proxy re-authorizations (#1346, #1347, #1353, #1358). - Isolated converged Codex sessions, deduplicated repeated stream errors, and added protective safety cooldowns (#1349).
- Improved streaming and WebSocket resilience: kept Responses WebSockets alive, preserved bootstrap failover, added keepalives during slow stream setup, buffered
response.metadataand chat role preambles, kept auth IDs across reply filtering, closed an auto-refresh blind spot on cloned refreshes, and added xAI 401 auto-recovery (#1354, #1355, #1356).
4. Routing, Model Filtering & Security
- Kept sticky sessions bound to their assigned account while saturated (#1329), returned
503instead of401when the identity store is unavailable (#1330), read live Codex subscription dates directly from provider billing (#1331), and reduced database load in the disabled-model filter (#1332, #1333). - Bumped
gorilla/websocketto resolve vulnerabilityGO-2026-6278(#1359).
Detailed Changes
Backend CliRelay
- chore(deps): bump
gorilla/websocketto fixGO-2026-6278(#1359) - fix(codex,tls,oauth): align probe/reauth client identity, unify TLS fingerprint across planes, and flag cross-proxy reauth (#1358)
- feat(billing): add paginated searchable billing targets endpoint (#1357)
- fix(auth,xai,stream): close auto-refresh blind spot, clear 401 on cloned refresh, and add xAI 401 auto-recovery (#1356)
- fix(stream,auth): buffer
response.metadata& chat role preamble and keep auth IDs across reply filter (#1355) - fix(codex,ws,stream): keep responses sockets alive, preserve bootstrap failover, and keepalive slow stream setup (#1354)
- fix(codex,auth,cluster): align official JSON refresh, sync
reauth_required, and fail-closed reauth proxy (#1353) - feat(errors): introduce unified structured actionable errors and strict sanitization (#1352)
- fix(codex,auth): isolate converged sessions, dedupe stream errors, and add safety cooldown (#1349)
- fix(auth): harden Codex OAuth refresh identity, fail-closed proxy, and reauth scheduling (#1347)
- fix(auth): harden Codex reauth deduplication, refresh guards, and status representative selection (#1346)
- fix(management): add dedicated Codex
reset-creditendpoint and clear structured frontend errors (#1343) - fix(billing): handle numeric XunhuPay
openid,total_amountquery field, and avoid Cloudflare 502 masking (#1340) - feat(billing): expose key-scoped billing overview, checkout & order history for
/apikey-usage(#1339) - feat(billing): support flexible expiry adjustment, cluster sync, and backdated manual orders (#1338)
- feat(billing): add portal self-service billing with XunhuPay and key QR pay links (#1337)
- test(nodemetrics): wait for counters to catch up with the response (#1334)
- fix(modelconfig): skip listing when no disabled model can reach the tenant (#1333)
- fix(modelconfig): read only
model_idandenabledfor the disabled-model filter (#1332) - feat(aiaccountstatus): read Codex subscription dates from the provider's billing (#1331)
- fix(identity): answer a store outage with
503instead of401(#1330) - fix(auth): keep a sticky session on its account while that account is saturated (#1329)
Upgrade Notes
- No breaking configuration migrations are required; existing configs upgrade in place.
- Self-service billing features stay inactive until XunhuPay / billing plans are configured in the admin console.
- Six-platform binaries and the multi-arch GHCR image
ghcr.io/kittors/clirelay:v0.7.0(bundling codeProxy v0.8.0) are published with this release.
中文说明(点击展开)
v0.7.0 - 门户自助计费、统一结构化错误体系与 Codex/OAuth 全链路加固
自 v0.6.5 起共 21 个 PR。与 codeProxy v0.8.0 配套发布:自助计费、结构化错误诊断与 Codex 原代理重授权需前后端协同启用。
核心更新
1. 门户自助计费与虎皮椒(XunhuPay)接入
- 新增基于虎皮椒的门户自助计费与 API Key 直达扫码支付链接,并为
/apikey-usage提供按 Key 维度的订阅概览、下单与订单历史接口(#1337、#1339)。 - 支持灵活调整有效期并同步至集群配置,支持补录历史日期的手工订单(#1338),新增支持分页与搜索的计费目标检索接口(#1357)。
- 兼容虎皮椒数字型
openid与total_amount查询字段,避免 Cloudflare 502 页面掩盖真实支付状态(#1340)。
2. 统一结构化可操作错误体系
- 引入统一的结构化可操作错误模型与严格脱敏机制,让客户端与管理台获得清晰一致的错误码和排查指引,同时避免泄露上游内部细节(#1352)。
- 新增 Codex 专用
reset-credit管理接口并规范前端结构化错误返回(#1343)。
3. Codex OAuth、TLS 指纹、重授权与流式稳定性加固
- 全链路加固 Codex OAuth 刷新与重授权:对齐官方 JSON 刷新格式、集群同步
reauth_required状态、重授权强制 fail-closed 代理校验、并发重授权去重、统一探测与重授权平面的 TLS 指纹与客户端身份,并对跨代理重授权进行标记(#1346、#1347、#1353、#1358)。 - 隔离收敛会话、去重重复流式错误并增加保护性安全冷却机制(#1349)。
- 增强流式传输与 WebSocket 稳定性:保持 Responses WebSocket 长连接活性、保留启动阶段故障切换、慢流建立期保活、缓冲
response.metadata与对话角色前导帧、在回复过滤链路中保留认证 ID、补齐克隆刷新的自动刷新盲区,并新增 xAI 401 自动恢复(#1354、#1355、#1356)。
4. 路由、模型过滤与安全修复
- 账号满载时保留粘性会话绑定(#1329);身份存储故障时返回
503而非误报401(#1330);从上游账单接口读取 Codex 实时订阅周期(#1331);优化禁用模型过滤查询降低数据库开销(#1332、#1333)。 - 升级
gorilla/websocket修复GO-2026-6278安全漏洞(#1359)。
详细变更
后端 CliRelay
- chore(deps):升级
gorilla/websocket修复GO-2026-6278(#1359) - fix(codex,tls,oauth):对齐探测与重授权客户端身份、跨平面统一 TLS 指纹并标记跨代理重授权(#1358)
- feat(billing):新增支持分页搜索的计费目标接口(#1357)
- fix(auth,xai,stream):补齐自动刷新盲区、清理克隆刷新 401 状态并新增 xAI 401 自动恢复(#1356)
- fix(stream,auth):缓冲
response.metadata与角色前导帧,并在回复过滤链路保留认证 ID(#1355) - fix(codex,ws,stream):保持 Responses WebSocket 活性、保留引导期故障转移并支持慢流保活(#1354)
- fix(codex,auth,cluster):对齐官方 JSON 刷新、集群同步
reauth_required并强化重授权代理 fail-closed(#1353) - feat(errors):引入统一结构化可操作错误模型与严格脱敏(#1352)
- fix(codex,auth):隔离收敛会话、流错误去重并新增安全冷却(#1349)
- fix(auth):加固 Codex OAuth 刷新身份、fail-closed 代理与重授权调度(#1347)
- fix(auth):加固 Codex 重授权去重、刷新保护与状态代表账号选择(#1346)
- fix(management):新增 Codex 专用
reset-credit接口并清理前端结构化错误(#1343) - fix(billing):兼容虎皮椒数字型
openid、total_amount查询字段并避免 Cloudflare 502 掩盖(#1340) - feat(billing):为
/apikey-usage提供按 Key 维度的账单概览、下单与订单历史接口(#1339) - feat(billing):支持灵活有效期调整、集群配置同步与补录历史日期手工订单(#1338)
- feat(billing):新增虎皮椒门户自助计费与 Key 扫码支付链接(#1337)
- test(nodemetrics):测试等待计数器追平响应状态以消除竞态(#1334)
- fix(modelconfig):租户无可达禁用模型时跳过列表查询(#1333)
- fix(modelconfig):禁用模型过滤仅读取
model_id与enabled字段(#1332) - feat(aiaccountstatus):从上游账单读取 Codex 实时订阅日期(#1331)
- fix(identity):身份存储不可用时返回
503而非401(#1330) - fix(auth):账号满载期间保持粘性会话绑定(#1329)
升级说明
- 无需破坏性配置迁移,现有配置可直接平滑升级。
- 自助计费功能在管理端配置虎皮椒与套餐前默认不激活。
- 本次同步发布六平台预编译二进制与多架构 GHCR 镜像
ghcr.io/kittors/clirelay:v0.7.0(内置 codeProxy v0.8.0 面板)。