Skip to content

gproxy v2.2.0

Choose a tag to compare

@LeenHawk LeenHawk released this 29 Jul 10:05

v2.2.0

Opens GPROXY to external channel crates: implement the new gproxy-channel-api contract, link your adapter into a custom binary, and it appears in the console alongside the built-ins. Also ships batch credential import, a large streaming/pipeline performance series (2-3x conversion-stream throughput), and fixes for the Responses→Claude path used by Codex CLI.

English

Added

  • External channel crates. Channel contracts are published as gproxy-channel-api on crates.io (MIT). Implement the Channel trait in your own crate, register it through the compile-time linkme slice, and link it into a custom binary via the reusable native entrypoint — no fork required. The admin API and console consume a runtime channel catalog, so external channels show up with their own settings forms. Ships with a complete examples/external-channel/ workspace and an Adding a Channel guide.
  • Batch credential import. New create-only POST /admin/providers/{pid}/credentials/import endpoint with per-item created/existing/error results. The console bulk import now covers every credential family — token lines for API keys and GitHub tokens, JSON array / JSONL / file upload for OAuth tokens and service accounts — in one request. Credentials without a label get an auto-generated display name (masked token, client_email, or account identity) across admin upsert, OAuth login, and CLI bundle import.
  • In-process load harness. A zero-network test harness drives the full 4×4 inbound/upstream matrix (streaming and buffered) for smoke validation, differential throughput tables, and memory-bounded concurrency ramps, plus --micro single-event conversion benchmarks.

Fixed

  • Responses→Claude (Codex CLI) path. Multi-turn codex exec resume requests no longer fail: replayed assistant history in easy-input content is accepted (#146), disable_parallel_tool_use is dropped when the assembled tools activate programmatic tool calling (an Anthropic 400), and a mid-conversation system block followed by user text is downgraded in place instead of producing an invalid turn order (another 400). Verified end-to-end against api.anthropic.com.
  • Claude shaping. Sampling parameters are stripped when thinking is enabled, and fallback-model injection is skipped for legacy Claude models that would reject it.
  • Observability. Upstream transport calls are now correlated in capture logs, so a request's attempts can be traced across failover.
  • Console metadata. Provider and credential forms are driven by the runtime channel catalog instead of hardcoded lists, keeping the console truthful for custom builds.

Changed

  • Streaming and pipeline performance. Conversion-stream throughput rises from ~9-16k to ~25-33k req/s at c=64: SSE frames parse zero-copy behind a cursor, per-event conversion drops its intermediate Value legs, and extensible enums no longer format unknown-variant errors on every custom model id. The request body is parsed once at classify time, independent counter I/O (rate limits, quota, budgets) runs in one parallel round, buffered-response settlement detaches from the response path, and the control-plane snapshot rebuilds in a single parallel read round (seconds faster on edge cold starts). Multipart bodies use SIMD boundary search with zero-copy parts, TLS fingerprints hash once per snapshot rebuild, and the bundled tokenizer preheats at bootstrap.
  • Dependencies. Routine bumps for the console and docs toolchains (vite, lucide-react, expressive-code).

简体中文

新增

  • 外部 Channel Crate。 Channel 契约以 gproxy-channel-api(MIT)发布到 crates.io。在自己的 crate 里实现 Channel trait,通过编译期 linkme slice 注册,再经可复用的 native 入口链接成自定义二进制 —— 无需 fork。Admin API 与控制台改为消费运行时 Channel Catalog,外部 Channel 会带着自己的设置表单出现在控制台中。附带完整的 examples/external-channel/ 工作区与 Adding a Channel 指南。
  • 凭证批量导入。 新增仅创建语义的 POST /admin/providers/{pid}/credentials/import,逐条返回 created/existing/error 结果。控制台批量导入覆盖所有凭证类型 —— API Key 与 GitHub Token 按行粘贴,OAuth Token 与 Service Account 支持 JSON 数组 / JSONL / 文件上传 —— 一次请求完成。未填写标签的凭证会自动生成显示名(掩码 Token、client_email 或账号身份),Admin 写入、OAuth 登录与 CLI bundle 导入共用同一逻辑。
  • 进程内压测工具。 零网络的测试 harness 驱动完整的 4×4 入站/上游矩阵(流式与缓冲),支持冒烟校验、差分吞吐表、内存受限的并发爬坡,以及 --micro 单事件转换基准。

修复

  • Responses→Claude(Codex CLI)路径。 多轮 codex exec resume 请求不再失败:easy-input content 中回放的 assistant 历史可以被接受(#146);当组装出的工具触发 Programmatic Tool Calling 时丢弃 disable_parallel_tool_use(此前触发 Anthropic 400);mid-conv system 块后跟用户文本时原地降级为普通文本块,不再产生非法的块顺序(另一处 400)。已对 api.anthropic.com 端到端验证。
  • Claude 整形。 开启 thinking 时剥离采样参数;对会拒绝注入的旧款 Claude 模型跳过 fallback 模型注入。
  • 可观测性。 Capture 日志现在会关联上游传输调用,可以跨 failover 追踪一次请求的各个 attempt。
  • 控制台元数据。 Provider 与凭证表单改由运行时 Channel Catalog 驱动而非硬编码列表,自定义构建下控制台展示与实际一致。

调整

  • 流式与管线性能。 转换流吞吐在 c=64 下从约 9-16k 提升到约 25-33k req/s:SSE 帧改为游标后借用的零拷贝解析,单事件转换去掉中间 Value 环节,可扩展枚举不再为每个自定义模型名格式化 unknown-variant 错误。请求体在 classify 阶段只解析一次,独立的计数器 I/O(限流、配额、预算)合并为一轮并行请求,缓冲响应的结算从响应路径中剥离,控制面快照改为单轮并行读取重建(边缘冷启动快数秒)。Multipart 使用 SIMD 边界搜索与零拷贝分片,TLS 指纹每次快照重建只哈希一次,内置分词器在启动时预热。
  • 依赖。 控制台与文档工具链例行更新(vite、lucide-react、expressive-code)。