- [Full Gemini 4 Family Support (Carbon/Argon/Hydrogen), 256k Output Cap & Per-Account Smart Dispatch] (Fixes #3922, Ref #3927, Thanks to @koeria, @lbjlaq):
- Official Catalog Alignment & 256k Output Token Cap: Closely tracking Google upstream staged rollout, added complete definitions for
gemini-4-carbonandgemini-4-hydrogenacross all tiers (bare, low, medium, high, xhigh) toofficial_models.json, alongside the missingxhightier forgemini-4-argon. AlignedmaxOutputTokensfor Carbon and Hydrogen to upstream's authoritative262,144(256k output tokens), overcoming the legacy 64k limit for monolithic tool calls and long-context generations. (Fixes #3922, Ref #3927) - Per-Account Capability Isolation & Smart Dispatch: Generalized catalog resolution and quota ingestion from single-model Argon logic into a unified Gemini 4 codename architecture (
carbon/argon/hydrogen). Strictly filtered upstream placeholder entries marked-disabledto prevent fictitious model injection into free or unauthorized accounts. The dispatcher routes high-tier model requests exclusively to Ultra and paid Pro accounts with positive quota (> 0%), completely eliminating 403 misrouting and cascade circuit-breaking. (Fixes #3922) - XHigh Tier Derivation & Base Bucket Normalization: Added
-xhighto bare-model suffix stripping and metadata generation inmodel_mapping.rs. Innormalize_to_standard_id, normalizedgemini-4-<codename>-*variants to their respective standard billing buckets, enabling isolated quota tracking and precise circuit-breaking per model family. (Ref #3927) - Gateway CLI Sync & Frontend View Alignment: Synchronized
CORE_GATEWAY_MODELSincli_sync.rswith Carbon, Argon, and Hydrogen 1M context definitions. Aligned frontendmodelConfig.ts,useProxyModels.tsx, andmodelCategory.ts, adhering to Single Source of Truth to present authentic, account-supported model catalogs.
- Official Catalog Alignment & 256k Output Token Cap: Closely tracking Google upstream staged rollout, added complete definitions for
- [OAuth Code Exchange Transient Retry & Clear Network Guidance] (Fixes #3920, Ref #3923, Thanks to @koeria, @lbjlaq):
- Exponential Backoff Retry for Transport Failures: Introduced up to 3 retry attempts with exponential backoff (500ms, 1000ms, etc.) in
exchange_code_once. Accurately differentiated transport-level drops (connection errors, timeouts, DNS failures) from Google 4xx responses: retrying strictly when authorization codes have not reached Google and remain unconsumed, salvaging transient hiccups and preventing repeated browser authorization loops. (Fixes #3920, Ref #3923) - Immediate 4xx Fast-Path & User Guidance: Short-circuited retries on 4xx business responses (e.g.
invalid_grant,unauthorized_client) to seamlessly engage client fallback chains. Clarified error messages when all attempts fail at transport level, informing users that the desktop client cannot connect to Google endpoints and directing them to verify proxy/network settings. (Fixes #3920, Ref #3923)
- Exponential Backoff Retry for Transport Failures: Introduced up to 3 retry attempts with exponential backoff (500ms, 1000ms, etc.) in
- [Actionable Banned-Pool Diagnostics & Self-Lock Prevention] (Fixes #3919, Ref #3924, Thanks to @koeria, @lbjlaq):
- Deep Pool-Depletion Diagnostics & Actionable Ban Alerts: Eradicated the misleading behavior where a pool consisting solely of banned accounts (upstream 403 TOS violation) or disabled accounts returned a generic 429 claiming accounts are cooling down. Implemented on-demand disk state scanning upon empty candidate pool, accurately reporting counts of banned, manually disabled, and unloaded accounts; explicitly informs users that banned accounts will not recover by waiting for cooldown, prompting them to review the Accounts page and submit appeals. (Fixes #3919, Ref #3924)
- Anti-Self-Lock Classifier Extension: Synchronized the upstream exhaustion classifier in
policy.rsto recognizeno available accounts, strictly preventing internal gateway depletion errors from triggering recursive self-locking cascades. (Ref #3924)
- [Linux File Descriptor Limit Raise & Migration Flap Eradication] (Fixes #3918, Ref #3928, Thanks to @koeria, @lbjlaq):
- Unix/Linux NOFILE Limit Raise to 4096: Expanded
increase_nofile_limit()frommacos-only to allunixtargets. Protects Linux servers from EMFILE exhaustion and GLibg_error()/abortcrashes caused by heavy concurrent TLS sockets, account disk I/O, and WebKitGTK IPC under the default 1024 limit. (Fixes #3918, Ref #3928) - Eradicated Config Migration Disk-Write Flap: Added
thinking_budget_32k_legacy_migratedtoThinkingBudgetConfig, eliminating the infinite write loop where missing deserialization targets causedsave_app_config()(write_atomic+sync_all) to trigger repeatedly on every config read. (Fixes #3918, Ref #3928)
- Unix/Linux NOFILE Limit Raise to 4096: Expanded
- [Gemini 4 全系新模型支持(Carbon/Argon/Hydrogen)、256k 巨型输出上限与账号级智能调度] (Fixes #3922, Ref #3927, Thanks to @koeria, @lbjlaq):
- 官方模型目录补齐与 256k 输出上限对齐: 紧跟 Google 官方上游模型灰度发布节奏,在内置模型目录表
official_models.json中全面补齐gemini-4-carbon与gemini-4-hydrogen全系列(含 bare, low, medium, high, xhigh 档位),并为gemini-4-argon补全xhigh极限思考档位;将 Carbon 与 Hydrogen 的maxOutputTokens精确对齐上游官方标称的262,144(256k tokens 输出),彻底突破旧版 64k 上限,完美满足超长上下文与深思考整包工具调用生成。(Fixes #3922, Ref #3927) - 账号能力智能隔离与逐号配额调度: 彻底重构模型目录解析与账号配额加载链路,将既有 Argon 专属逻辑全面泛化为 Gemini 4 代号模型族体系(
carbon/argon/hydrogen);严格过滤上游下发的-disabled占位条目,禁止为未获授权或免费普通账号注入虚假高阶模型;调度器仅在具体账号真实具备对应代号授权与正额度(positive quota > 0%)时才赋予调度资格,确保高阶模型请求精准路由至具备能力的 Ultra/付费 Pro 账号,杜绝跨号误派发引发的 403 报错与号池熔断。(Fixes #3922) - 极高思考档位剥离与基底桶归一化: 在
model_mapping.rs中为裸模型派生与元数据生成补充-xhigh档位后缀剥离支持;在normalize_to_standard_id中将gemini-4-<codename>-*各变体归一化至对应的基底标准计费桶,实现各模型族独立配额追踪与精准熔断自愈。(Ref #3927) - 网关 CLI 同步与前端配置对齐: 在
cli_sync.rs的CORE_GATEWAY_MODELS中同步补齐 Carbon、Argon 与 Hydrogen 各档位及 1M 上下文规格;同步更新前端modelConfig.ts、useProxyModels.tsx与modelCategory.ts,严格遵循 Single Source of Truth,提供纯净的账号真实可用模型视图。
- 官方模型目录补齐与 256k 输出上限对齐: 紧跟 Google 官方上游模型灰度发布节奏,在内置模型目录表
- [OAuth 授权码兑换瞬态网络错误重试与精准网络指引] (Fixes #3920, Ref #3923, Thanks to @koeria, @lbjlaq):
- 传输层瞬态失败指数退避重试: 在
oauth.rs的exchange_code_once中引入最多 3 次退避重试机制(500ms、1000ms 等)。精准区分传输层网络中断(连接失败、请求超时、DNS 解析异常)与 Google 4xx 业务响应:仅在授权码未到达 Google 未被消耗的瞬态阶段触发自动重试,挽救因网络抖动导致的授权中断,避免用户频繁重跑浏览器授权。(Fixes #3920, Ref #3923) - 4xx 业务错误即刻短路与友好诊断提示: 当遭遇 4xx 业务状态码(如
invalid_grant、unauthorized_client)时即刻终止重试,无缝衔接多客户端 Fallback 兜底;当所有重试均为传输层失败时,明确提示“浏览器已成功授权但桌面客户端无法直连 Google 授权端点”,引导用户检查代理配置与网络连通性,消除“授权莫名失败”的误导性体验。(Fixes #3920, Ref #3923)
- 传输层瞬态失败指数退避重试: 在
- [全池账号封禁明确诊断与免自锁自愈] (Fixes #3919, Ref #3924, Thanks to @koeria, @lbjlaq):
- 池空状态深度诊断与封禁明确告警: 彻底根治号池内所有账号因上游封禁(403 TOS 违规)或全部手动停用后,网关向客户端误报“429 限流冷却中,等待即可恢复”的严重误导体验。在候选池为空时按需执行轻量级磁盘状态扫描,精准统计封禁(banned)、手动停用(disabled)与未载入账号状态;针对封禁账号明确指出“封禁账号绝不可能通过等待冷却恢复,请前往账号管理页面检查或提交申诉”,帮助用户第一时间定位故障。(Fixes #3919, Ref #3924)
- 防自锁分类器拓展与分类隔离: 在
policy.rs分类器中同步拓展针对“无可用账号”诊断特征(no available accounts)的安全识别,杜绝网关内部错误在无账号可用时发生错误递归自噬与雪崩。(Ref #3924)
- [Linux 文件句柄上限扩展与配置迁移死循环落盘消除] (Fixes #3918, Ref #3928, Thanks to @koeria, @lbjlaq):
- Unix/Linux 文件句柄上限提升至 4096: 将
increase_nofile_limit()从单限定macos扩展至全体unix平台。消除多账号大并发网络连接、TLS Socket 与文件读写在 Linux(系统默认RLIMIT_NOFILE = 1024)上瞬间打满导致底层 GLibg_error()/abort崩溃隐患。(Fixes #3918, Ref #3928) - 消除配置迁移死循环强制刷盘: 在
ThinkingBudgetConfig中补齐thinking_budget_32k_legacy_migrated标志字段,彻底解决每次读取配置都判定为“未迁移”导致频繁调用write_atomic+sync_all循环落盘并引发瞬时 I/O 阻塞的确定性缺陷。(Fixes #3918, Ref #3928)
- Unix/Linux 文件句柄上限提升至 4096: 将
Full Changelog: v5.0.4-beta.7...v5.0.4-beta.8