- [Hardened Account-Switch Persistence, Instant Quota Depletion Marking & Safe Optimistic Reset] (PR #3664, Fixes #3639, Fixes #3637, Thanks to @modded-soldier-9):
- Account Switch Downgrade Fallback Hardening (Fixes #3637): In
integration.rs, ensuredapply_account_credentialsis called again after fully terminating the main process during cold restart or timeout fallbacks, eliminating race conditions where external client exit hooks could overwrite credentials with stale tokens. (PR #3664, Fixes #3637, Thanks to @modded-soldier-9) - Preserve Exact CLI Argument Case: Preserved original argument case snapshots in
process.rs, limiting lowercase transformations strictly to internal helper process matching. Completely eliminates corrupted workspace paths and empty workspace errors on case-sensitive Linux and macOS file systems. (PR #3664, Thanks to @modded-soldier-9) - OpenAI 429 Atomic Fast Lockout: Unified atomic
mark_rate_limited_fastcalls inhandle_chat_completionsandhandle_completionsto instantly lock in-memory rate limits within 0ms, eliminating redundant candidate re-selections during attempt 1 retries while background quota network checks are pending. (PR #3664, Thanks to @modded-soldier-9) - Reactive In-Memory Quota Depletion Marking (Fixes #3639): Introduced
mark_model_quota_depletedto reactively updatetoken.model_quotasin-memory cache to 0% immediately upon receiving upstreamQuotaExhaustederrors, ensuring sticky sessions and preferred accounts auto-migrate seamlessly on subsequent turns. (PR #3664, Fixes #3639, Thanks to @modded-soldier-9) - Optimistic Reset Quota Safeguard & Ceiling Wait Times: Optimized
clear_for_optimistic_resetto strictly retain all activeQuotaExhaustedentries and prioritize healthy candidates with positive quota; updatedrate_limit.rsto compute remaining wait durations with ceiling rounding, eradicating premature wakeups and accidental routing to 0% accounts. (PR #3664, Thanks to @modded-soldier-9)
- Account Switch Downgrade Fallback Hardening (Fixes #3637): In
- [Concurrency-Aware Traffic Spillover Scheduling & Max Spillover Cap] (PR #3662, Thanks to @zepeng-jin):
- In-Flight Concurrency Tracking (InFlightGuard): Implemented an RAII guard tracking active requests per account atomically across streaming and non-streaming HTTP responses in Claude, Gemini, and OpenAI proxy handlers. (PR #3662, Thanks to @zepeng-jin)
- Concurrency-Aware Traffic Spillover: Enhanced
select_with_p2cso that when primary accounts are saturated with active in-flight requests (in_flight > 0), subsequent concurrent requests smoothly spill over to idle/lower-load accounts to eliminate head-of-line blocking in multi-session and parallel agent workloads, while proactively bypassing 0% quota accounts to prevent 429 errors. (PR #3662, Thanks to @zepeng-jin) - Configurable Spillover Account Cap (max_spillover_accounts): Added support for capping the maximum number of distinct accounts concurrently engaged (0 for unlimited; N > 0 caps active accounts to N), with interactive slider controls and full translations in the Proxy Scheduling Settings UI. (PR #3662, Thanks to @zepeng-jin)
- [High-Resolution Minute-Level Token Analytics & Granular Trends] (PR #3663, Thanks to @zepeng-jin):
- Backend Minute Aggregation Endpoints: Introduced
get_minute_stats,get_model_trend_minute, andget_account_trend_minuteintoken_stats.rs, aggregating usage by minute timestamp (%Y-%m-%d %H:%M) across 1h and 24h spans via Tauri IPC commands. (PR #3663, Thanks to @zepeng-jin)
- Backend Minute Aggregation Endpoints: Introduced
- [Official Deprecated Model Interface Alignment, Gemini 4 Argon Support & Dynamic Capability Filtering]:
- Automated Deprecated Model Pruning: Upgraded
useProxyModelsto dynamically inspect accountmodel_forwarding_rules(from GoogledeprecatedModelIds), automatically pruning deprecated and redirected model aliases from client UI. - Active Family Baseline Convergence: Automatically pruned obsolete transitional sub-versions (3.5, 3.6, 3.7) when a higher active minor version like
gemini-3.8-flashis present in the account pool, keeping supported model listings sleek; added forward-looking high-contrast icons and groups for Gemini 4 Argon. - Capability-First Dynamic Scheduling for Gemini 4 Argon & Claude 5.x: Generalized dynamic capability detection in
model_specs.rsandtoken_manager.rsto strictly route requests only to accounts reporting active model capabilities inmodel_quotas/model_limits, eliminating accidental routing of canary models to ungranted accounts.
- Automated Deprecated Model Pruning: Upgraded
- [加固切号持久化、配额即时耗尽标记与乐观重置保底] (PR #3664, Fixes #3639, Fixes #3637, Thanks to @modded-soldier-9):
- 切号降级闭环加固 (Fixes #3637): 在
integration.rs的冷重启与超时降级路径中,确保在彻底杀死主进程后再次调用apply_account_credentials,消除外部客户端退出钩子的回写竞态,彻底杜绝主进程退出覆盖旧 Token。 (PR #3664, Fixes #3637, Thanks to @modded-soldier-9) - 命令行原始参数大小写保真: 在
process.rs中保留启动快照参数的原始大小写,仅在比对 helper 辅助进程时内部转小写匹配,彻底根治 Linux / macOS 大小写敏感文件系统下工作区路径被篡改导致打开空工作区或启动报错的问题。 (PR #3664, Thanks to @modded-soldier-9) - OpenAI 429 原子快速加锁: 统一在
handle_chat_completions与handle_completions中调用mark_rate_limited_fast,在 0ms 内原子锁定内存限流状态,消除 50ms 轮换延时前因实时配额网络请求未完成导致的同一账号竞争重选。 (PR #3664, Thanks to @modded-soldier-9) - 响应式内存配额耗尽标记 (Fixes #3639): 新增
mark_model_quota_depleted,在上游判定为QuotaExhausted或实时配额刷新成功后立即响应式更新token.model_quotas内存缓存,确保粘性会话与固定账号在下一轮次立刻无感迁移。 (PR #3664, Fixes #3639, Thanks to @modded-soldier-9) - 乐观重置配额耗尽安全守卫与等待时间向上取整: 优化
clear_for_optimistic_reset,保留所有生效中的QuotaExhausted记录,且重选候选时优先挑选具备正额度的账号;并在rate_limit.rs中将剩余等待时长改为向上取整(Ceil),并在缓冲等待加入容差,杜绝提前唤醒与误放行 0% 额度账号。 (PR #3664, Thanks to @modded-soldier-9)
- 切号降级闭环加固 (Fixes #3637): 在
- [并发感知流量溢出调度与最大溢出账号上限控制] (PR #3662, Thanks to @zepeng-jin):
- 在途并发追踪 (InFlightGuard): 实现基于 RAII 的在途请求原子计数守卫,绑定到 Claude、Gemini、OpenAI 代理的流式与非流式响应生命周期,精确跟踪每个账号的实时并发负载。 (PR #3662, Thanks to @zepeng-jin)
- 感知并发的流量溢出调度: 在 P2C 选号算法中,当活跃主账号正在处理在途请求(
in_flight > 0)时,后续并发请求自动平滑外溢到次高优先级或空闲/低负载账号,打破多会话与多 Agent 并行场景下的队头阻塞;并主动绕过 0% 配额账号以规避 429 报错。 (PR #3662, Thanks to @zepeng-jin) - 可配置溢出账号上限 (max_spillover_accounts): 支持设置并发调度时参与外溢的最大账号数(默认 0 为不限制;N > 0 时最多允许 N 个账号同时参与调度),防止无节制激活过多账号,并在 UI 调度设置面板提供滑动条调节与多语言支持。 (PR #3662, Thanks to @zepeng-jin)
- [支持分钟级高分辨率 Token 统计与细粒度趋势展示] (PR #3663, Thanks to @zepeng-jin):
- 后端分钟级聚合接口: 在
token_stats.rs中新增get_minute_stats、get_model_trend_minute与get_account_trend_minute,按分钟粒度(%Y-%m-%d %H:%M)精准聚合 Token 消耗,支持 1h 与 24h 时间跨度并通过 Tauri IPC 命令暴露。 (PR #3663, Thanks to @zepeng-jin)
- 后端分钟级聚合接口: 在
- [官方废弃模型接口自动对齐、Gemini 4 Argon 支持与高阶灰度动态能力自适应收敛]:
- 废弃模型接口自动感知与淘汰: 前端
useProxyModels自动读取全账号model_forwarding_rules(官方上游deprecatedModelIds),自动淘汰被上游废弃并重定向的老旧模型条目。 - 家族活跃基准线动态剪枝: 当账号池中存在
gemini-3.8-flash等更高小版本时,自动过滤历史过渡小版本(3.5、3.6、3.7),保持支持模型列表极简清爽;并为新一代 Gemini 4 (Argon) 预置高质感品牌图标与分组。 - Gemini 4 Argon 与 Claude 5.x 动态能力过滤 (Capability-First): 在
model_specs.rs与token_manager.rs中将高阶灰度模型纳入动态能力收敛体系,100% 依据各账号实际返回的配额与模型能力目录(model_quotas/model_limits)自适应调度,彻底杜绝高阶模型误路由至未获上游授权的账号。
- 废弃模型接口自动感知与淘汰: 前端
What's Changed
- feat(proxy): support concurrency-aware spillover scheduling and max accounts cap by @zepeng-jin in #3662
- feat(token-stats): support minute-level aggregated stats and granular trends by @zepeng-jin in #3663
- fix(proxy,client): 加固切号持久化、配额即时耗尽标记与乐观重置保底 (Fixes #3639, Fixes #3637) by @modded-soldier-9 in #3664
Full Changelog: v4.9.7-beta.10...v4.9.7-beta.11