- [Fix Safety Category Whitelist Filtering, Claude Tool Call Sentinel Injection, Shell Tool Name Alignment & Pro Quota Floor] (PR #3652, Fixes #3195, Fixes #3202, Fixes #3229, Fixes #3224, Fixes #3215, Thanks to @modded-soldier-9):
- Self-Healing Thought Signatures for Claude Tool Calls (Fixes #3202, Fixes #3229): Removed the outbound Gatekeeper exemption for Claude models. Because Google's
v1internalendpoint enforces ASTfunctionCall.thoughtSignatureverification across all models indiscriminately, Gatekeeper now automatically backfills the official sentinel signature on any function calls missing signatures during multi-turn interactions in Claude Code CLI and Desktop, eradicating400 missing thought_signatureerrors. (PR #3652, Thanks to @modded-soldier-9) - Strict Whitelist Filtering for Safety Categories (Fixes #3195): Enforced strict whitelist filtering on
safetySettingsin the inbound pipeline (inbound.rs), retaining only the 5 valid categories officially recognized by Google Gemini (HARASSMENT,HATE_SPEECH,SEXUALLY_EXPLICIT,DANGEROUS_CONTENT,CIVIC_INTEGRITY). Completely eliminates400 INVALID_ARGUMENT (element predicate failed)errors caused by Codex/v1/responsespassing deprecated or custom categories. (PR #3652, Thanks to @modded-soldier-9) - Intelligent Shell Tool Name Alignment (Fixes #3224): Enhanced
resolve_shell_tool_nameinresponse.rswith client declaration awareness. When clients only declarebashwhile the model invokeslocal_shell_callorshell_command, automatically maps the call tobash, preventing client errors such asModel tried to call unavailable tool 'local_shell_call'. (PR #3652, Thanks to @modded-soldier-9) - Pro Model Fallback Ordering Optimization & Output Token Floor (Fixes #3215): Optimized candidate ordering for
pro_familyintoken_manager.rsto prioritize full-spec models (gemini-3.1-pro-highandgemini-3.1-pro-preview) over legacygemini-pro-agentchannels; enforced an 8,192 token floor inget_max_output_tokenswithinmodel_specs.rsto prevent long generations from being truncated by restrictive 2k agent limits. (PR #3652, Thanks to @modded-soldier-9)
- Self-Healing Thought Signatures for Claude Tool Calls (Fixes #3202, Fixes #3229): Removed the outbound Gatekeeper exemption for Claude models. Because Google's
- [Account Card and List Weekly View Stacked Layout Polishing] (PR #3655, Ref #3189, Thanks to @ilyassbourass):
- Stacked Presentation of Weekly & 5H Rolling Quotas: Streamlined display behavior in
AccountCard.tsxandAccountTable.tsxwhen switching to the 7-day Weekly view. Instead of replacing per-model 5H quotas entirely with generic weekly buckets, both are now stacked: per-model 5H quotas remain on top, while 7-day weekly buckets are placed underneath separated by a soft blue divider with tinted borders, providing instant visibility into both short-term availability and weekly budget caps. (PR #3655, Thanks to @ilyassbourass)
- Stacked Presentation of Weekly & 5H Rolling Quotas: Streamlined display behavior in
- [Upstream Endpoint Dynamic Health Tracking & Transport Timeout Convergence] (PR #3657, Fixes #3635, Ref #3525, Ref #3593, Thanks to @cubelikeplayDaniel):
- Dynamic Endpoint Health Tracker (EndpointHealthTracker): Introduced an in-memory health tracking mechanism backed by
DashMapand a 60-second cooldown TTL inupstream/client.rs. Dynamically reorders candidate endpoints for streaming (call_v1_internal_with_headers) and auxiliary (call_v1_internal_auxiliary) requests: healthy endpoints are tried first, while endpoints currently in cooldown are deprioritized to the tail for probing, self-healing instantly upon a successful response. Completely eradicates stateless 40s cascading timeout loops on dead endpoints for subsequent in-session requests, stabilizing TTFT back to 1~2s native performance. (PR #3657, Thanks to @cubelikeplayDaniel) - Transport Connect and Idle Timeout Convergence: Tightened
connect_timeoutfrom 20s to 5s to rapidly flag unreachable endpoints during initial probing, shrinking worst-case cascading failover delay from 40s to under 10s; and reducedpool_idle_timeoutfrom 90s to 45s to match Google Front End (GFE) silent TCP termination windows, eliminatingerror reading a body from connectioncaused by reusing dead sockets. (PR #3657, Thanks to @cubelikeplayDaniel)
- Dynamic Endpoint Health Tracker (EndpointHealthTracker): Introduced an in-memory health tracking mechanism backed by
- [Pass-Through and Visualize Physical Upstream Model Versions] (PR #3658, Resolves #3654, Thanks to @modded-soldier-9):
- X-Upstream-Model Response Header Normalization: Injected the standard
X-Upstream-Modelheader across OpenAI, Claude, Gemini, and Warmup protocol responses to provide full downstream transparency into the exact physical model deployed upstream. (PR #3658, Thanks to @modded-soldier-9) - Physical Version Resolution & Full Observability: The monitoring middleware now captures raw physical
modelVersionsignatures from SSE candidate streams and non-streaming responses, persisting them automatically into therequest_logsdatabase; fully surfaced inProxyMonitor(rendered asRequested => Mapped (⚡ Physical Upstream)) and theMiniViewfloating bar. (PR #3658, Thanks to @modded-soldier-9)
- X-Upstream-Model Response Header Normalization: Injected the standard
- [修复安全分类校验过滤、Claude工具调用哨兵注入、shell工具别名对齐与Pro模型限额截断] (PR #3652, Fixes #3195, Fixes #3202, Fixes #3229, Fixes #3224, Fixes #3215, Thanks to @modded-soldier-9):
- Claude 模型工具调用签名自愈 (Fixes #3202, Fixes #3229): 移除出站门禁(Gatekeeper)中对 Claude 模型的签名豁免限制。由于 Google
v1internal统一对底层全部模型施加严格的 ASTfunctionCall.thoughtSignature校验,在 Claude Code CLI 与 Desktop 端的多轮工具调用中对缺失签名的functionCall自动回填官方哨兵签名,彻底消除missing thought_signature400 拦截报错。 (PR #3652, Thanks to @modded-soldier-9) - 安全设置分类严格白名单过滤 (Fixes #3195): 在进站管线
inbound.rs中对客户端传递的safetySettings执行严格白名单过滤,仅保留 Google Gemini 规范明确支持的五大合法分类(HARASSMENT、HATE_SPEECH、SEXUALLY_EXPLICIT、DANGEROUS_CONTENT、CIVIC_INTEGRITY),彻底杜绝 Codex/v1/responses因携带废弃或非标分类被 Google 报错400 INVALID_ARGUMENT (element predicate failed)。 (PR #3652, Thanks to @modded-soldier-9) - Shell 工具名称智能对齐 (Fixes #3224): 在
response.rs的resolve_shell_tool_name中引入客户端声明感知。当客户端未声明local_shell_call但声明了bash时,自动将模型习惯性调用的local_shell_call/shell_command对齐映射为bash,杜绝 Cline 等客户端报错Model tried to call unavailable tool 'local_shell_call'。 (PR #3652, Thanks to @modded-soldier-9) - Pro 系列模型动态降级优化与输出上限保底 (Fixes #3215): 在
token_manager.rs中优化pro_family候选排序,优先保留gemini-3.1-pro-high与gemini-3.1-pro-preview等全规格模型,避免优先选用仅有 2k 输出上限的旧版gemini-pro-agent;并在model_specs.rs的get_max_output_tokens增加 8192 保护底线,防止模型长文本生成被异常卡死截断。 (PR #3652, Thanks to @modded-soldier-9)
- Claude 模型工具调用签名自愈 (Fixes #3202, Fixes #3229): 移除出站门禁(Gatekeeper)中对 Claude 模型的签名豁免限制。由于 Google
- [账号列表与卡片周配额视图上下堆叠体验优化] (PR #3655, Ref #3189, Thanks to @ilyassbourass):
- 周配额与 5H 滚动配额上下并列呈现: 优化账号卡片(
AccountCard.tsx)与列表(AccountTable.tsx)在切换至「周配额」窗口时的展示逻辑。由原先粗暴替换 5H 配额药丸改为上下分层堆叠:上方保留各模型的 5H 实时滚动配额,下方以淡蓝色分割线及边框并列呈现 7 天周配额胶囊,无需在两类视图间来回切换即可一眼兼顾实时可用量与本周总余量。 (PR #3655, Thanks to @ilyassbourass)
- 周配额与 5H 滚动配额上下并列呈现: 优化账号卡片(
- [上游端点动态健康追踪与传输超时收敛,根治 40~50s 级联等待延迟] (PR #3657, Fixes #3635, Ref #3525, Ref #3593, Thanks to @cubelikeplayDaniel):
- 动态端点健康追踪器 (EndpointHealthTracker): 在
upstream/client.rs中引入基于DashMap与 60 秒冷却 TTL 的端点健康追踪机制。在流式(call_v1_internal_with_headers)与辅助(call_v1_internal_auxiliary)请求中依据健康状态动态重排候选端点:健康端点第一优先路由,冷却期内的故障端点降级至末尾备用探活,一旦请求成功立即自愈恢复健康。彻底消除上一个请求踩坑超时后、后续同一会话请求依然无状态重复硬等 40s 死端点的缺陷,首包响应时间(TTFT)稳定降至 1~2s 原生水准。 (PR #3657, Thanks to @cubelikeplayDaniel) - 传输层建连与连接池超时收敛: 将 TCP/TLS 建连超时(
connect_timeout)由 20s 收敛至 5s,在冷启动首次探活期间即可迅速识别死端点,最坏情况级联延迟由 40s 压缩至 10s 以内;并将连接池空闲超时(pool_idle_timeout)由 90s 收敛至 45s,对齐 Google 前端网关(GFE)静默断流窗口,彻底杜绝复用已断开 TCP 连接引发error reading a body from connection的断流问题。 (PR #3657, Thanks to @cubelikeplayDaniel)
- 动态端点健康追踪器 (EndpointHealthTracker): 在
- [透传与可视化物理上游模型版本] (PR #3658, Resolves #3654, Thanks to @modded-soldier-9):
- X-Upstream-Model 响应头标准透传: 在 OpenAI、Claude、Gemini 与 Warmup 各协议网关响应中统一注入
X-Upstream-Model响应头,便于下游开发环境与调试抓包透明感知真实执行的上游物理模型版本。 (PR #3658, Thanks to @modded-soldier-9) - 真实版本解析与大盘全链路可视化: 监控中间件从流式 SSE 候选帧(
modelVersion)及非流式响应中自动捕获上游物理版本,自愈存储至request_logs数据库;并在ProxyMonitor监控表格(以请求模型 => 映射模型 (⚡ 真实物理版本))及MiniView迷你悬浮条中清晰呈现。 (PR #3658, Thanks to @modded-soldier-9)
- X-Upstream-Model 响应头标准透传: 在 OpenAI、Claude、Gemini 与 Warmup 各协议网关响应中统一注入
What's Changed
- fix(pipeline,tools): 修复安全分类校验过滤、Claude工具调用哨兵注入、shell工具别名对齐与Pro模型限额截断 (Fixes #3195, #3202, #3229, #3224, #3215) by @modded-soldier-9 in #3652
Full Changelog: v4.9.7-beta.8...v4.9.7-beta.9