- [Native
tieredModelIdsBackground Model Routing,gemini-3.1-flash-lite-previewBuilt-in Mapping & Single-Pass Protocol Gate Reuse] (Fixes #4084, PR #4085, Thanks to @fPip98):- Native
tieredModelIdsDerivation & Cache-First Pool Selection: Persisted per-accountaccountTieredModels(flashLite->flash) anddeprecatedModelIdsfrom livefetchAvailableModelsintoofficial_models_live_cache.json, building deterministic(rank, support_count, id)candidate chains (filteringdisabled/retired models, prioritizing non-Leaving Soon, and validating disk LKG) that work cleanly across FREE/PRO/ULTRA accounts without relying on orchestrator copy; introducedauto:background(keepingauto:gemini-flash-lowcompatibility) andTokenManager::has_available_model_scopedso user manual background model overrides stay highest priority, cache-first locking preserves main-session sticky bindings and multi-turn subagent Prompt Cache, restricted pools fall back smoothly to pool-supportedflashcandidates, and unsupported pools return HTTP 503 with an actionable configuration hint. (Fixes #4084, PR #4085, Thanks to @fPip98) - Built-in
gemini-3.1-flash-lite-previewNon-Resurrecting Mapping & Protocol Routing Fixes: Added built-in non-exposedgemini-3.1-flash-lite-preview -> auto:backgroundmapping withbuiltin_mapping_versionbumped to2(one-time migration preserving user overrides and deletions), aligned frontend presets and 12-locale copy, reused zero-cloneModelGateresolution across all 4 protocols (including Gemini:countTokensand standalonehandle_count_tokens), eliminated raw"auto:..."literal leakage inclaude.rs, and preserved original requested model names for-onlinegrounding alongside the bare-model custom mapping contract when effort is unset. (Fixes #4084, PR #4085, Thanks to @fPip98)
- Native
- [Ciphertext Auth Rejection, Private
0600/0700Modes, Loopback Host-FS Guards & Deadhttp_apiRemoval] (Ref #4039, Ref #4065, PR #4086, Thanks to @zainulhasan):- Fail-Closed Auth & IP Filter Hardening: Added
crypto::is_undecrypted_ciphertextto reject undecryptedag_enc_*/ag_enc_v2_*credentials with HTTP 401 before secret comparison inauth_middleware_internal, and tightenedip_filter::extract_client_ipto fail closed (cfg!(test)) instead of trusting forwarded headers whenConnectInfois absent in production. (Ref #4039, Ref #4065, PR #4086, Thanks to @zainulhasan) - Private Unix File/Dir Modes & Debug Log Filename Sanitization: Updated
utils::fs::write_atomicon Unix to create temporary files withcreate_new(true)and mode0600, set mode0700on newly created data and accounts directories inmodules::account, and sanitizedtrace_idindebug_logger::build_filenamevia an ASCII allowlist and length cap. (Ref #4039, PR #4086, Thanks to @zainulhasan) - Loopback-Only Host-FS Admin Routes & Dead
http_apiCleanup: GuardedPOST /api/system/data-dir,POST /api/system/open-folder, andPOST /api/accounts/import/db-customwithrequire_unproxied_loopback(returning HTTP 403 for non-loopback or forwarded requests), and removed the unused unauthenticatedmodules/http_api.rsmodule along with its commands, routes, and unusedAppState.thought_signature_map. (Ref #4039, Ref #4065, PR #4086, Thanks to @zainulhasan)
- Fail-Closed Auth & IP Filter Hardening: Added
- [Harden CLI & Factory Droid Credential Writes, Shell Quoting, Concurrency Locks & Version Probes] (Ref #4039, Ref #4065, PR #4091, Thanks to @UnnamedPeople-Chin):
- Restricted Atomic Writes & Safe Backup/Binary Restore: Added
write_atomic_restricted(enforcing explicit0600/0700Unix modes and parent-dir creation while keepingwrite_atomicdefault0600) andreplace_file_atomicinutils::fs(removing destructiveremove_file(src)on WindowsMoveFileExWfailure so.antigravity.bakbackups andagybinaries are never lost), replacing predictable.tmpwrites acrosscli_sync.rsanddroid_sync.rs. (Ref #4039, Ref #4065, PR #4091, Thanks to @UnnamedPeople-Chin) - Shell/Batch/Env Neutralization, Config Mutexes & Bounded Probes: Added
utils::command::output_with_timeout(5s hard timeout, null stdin, and detached pipe readers on timeout to avoid grandchild pipe hangs) for CLI/Droid lookup and--versionprobes; serializedcli_syncanddroid_syncconfig/backup/restore via mutexes (sync_config_unlockedpreventing restore deadlock) and safe Droid path checks; neutralized injection inagy/agy.sh(POSIX single-quoting),agy.cmd,.env, and.credentials.yaml. (Ref #4039, Ref #4065, PR #4091, Thanks to @UnnamedPeople-Chin)
- Restricted Atomic Writes & Safe Backup/Binary Restore: Added
- [Fix Linux/macOS Lightweight-Mode Single-Instance Reopen Deadlock] (Fixes #4093, PR #4094, Thanks to @fPip98):
- Unified Main-Thread Dispatch Across All Desktop Platforms: Relaxed
lightweight::defer_on_main_threadto all desktop platforms (not(target_os = "android")) and routedtauri_plugin_single_instance::inituniformly through it, eliminatingWindowStateCacheAB-BA deadlocks and piled-up launcher processes when reopening from Linuxzbusor macOS Tokio worker threads while preserving Windows#3993deferral behavior. (Fixes #4093, PR #4094, Thanks to @fPip98)
- Unified Main-Thread Dispatch Across All Desktop Platforms: Relaxed
- [原生
tieredModelIds后台任务模型动态推导、gemini-3.1-flash-lite-preview默认映射与四协议门禁复用] (Fixes #4084, PR #4085, Thanks to @fPip98):- 原生
tieredModelIds驱动与缓存优先号池调度: 从官方fetchAvailableModels实时按账号覆盖持久化accountTieredModels(flashLite→flash)与deprecatedModelIds,按(官方顺位, 支持账号数, id)确定性生成候选链(跳过disabled/已下线、优先非Leaving Soon、校验磁盘 LKG),兼容无orchestrator条目的纯 FREE/PRO 账号;新增auto:background(兼容auto:gemini-flash-low)与TokenManager::has_available_model_scoped,在保留用户手动「后台任务模型」最高优先级的前提下,优先锁定全档位共享且有正配额的首选模型以保护主会话粘性与多轮子代理 Prompt Cache,受限号池无flashLite时自动顺延至号池支持的flash候选,均不支持时返回 HTTP 503 并提示手动配置。(Fixes #4084, PR #4085, Thanks to @fPip98) - 内置
gemini-3.1-flash-lite-preview防复活映射与四协议单次解析修复: 默认新增不对外暴露的gemini-3.1-flash-lite-preview -> auto:background映射并将builtin_mapping_version升至2(老配置自动补写一次、保留用户自定义、删除不复活),同步更新前端默认预设与 12 国多语言说明;四协议(Gemini 含:countTokens与独立handle_count_tokens、Claude、OpenAI Chat/Responses)统一复用ModelGate零克隆单次解析结果,修复claude.rs写回"auto:..."字面量泄漏,同时保留原始请求名以完整维持-online联网探测及「自定义映射裸模型在未传 effort 时不改写默认档位」契约。(Fixes #4084, PR #4085, Thanks to @fPip98)
- 原生
- [密文鉴权拦截、凭据文件私有权限、宿主机 FS 接口回环限制与清理废弃
http_api] (Ref #4039, Ref #4065, PR #4086, Thanks to @zainulhasan):- 鉴权与 IP 过滤 Fail-Closed 收紧: 新增
crypto::is_undecrypted_ciphertext并在auth_middleware_internal校验前直接拦截未解密的ag_enc_*/ag_enc_v2_*密文返回 HTTP 401;将ip_filter::extract_client_ip缺失ConnectInfo时的转发头信任回退收紧为cfg!(test),生产环境严格 Fail-Closed。(Ref #4039, Ref #4065, PR #4086, Thanks to @zainulhasan) - 私有文件/目录权限与调试日志文件名净化: Unix 下
utils::fs::write_atomic改用create_new(true)+0600创建私有临时文件,modules::account新建数据目录与账号目录设为0700;debug_logger::build_filename对trace_id执行字符白名单净化与长度截断,消除路径穿越风险。(Ref #4039, PR #4086, Thanks to @zainulhasan) - 宿主机文件系统管理路由回环门禁与清理未鉴权死模块: 为
POST /api/system/data-dir、POST /api/system/open-folder、POST /api/accounts/import/db-custom增加require_unproxied_loopback校验(非本机直连或携带转发头返回 HTTP 403);移除从未启用的未鉴权遗留模块modules/http_api.rs、对应命令/路由及未使用字段AppState.thought_signature_map。(Ref #4039, Ref #4065, PR #4086, Thanks to @zainulhasan)
- 鉴权与 IP 过滤 Fail-Closed 收紧: 新增
- [CLI 与 Factory Droid 凭据写入权限、Shell 转义、并发锁与版本探测超时加固] (Ref #4039, Ref #4065, PR #4091, Thanks to @UnnamedPeople-Chin):
- 原子受限写入与安全恢复: 在
utils::fs新增write_atomic_restricted(支持显式0600/0700权限与自动创建父目录,保留write_atomic默认0600)及replace_file_atomic(修复 WindowsMoveFileExW失败误删源文件隐患,保护.antigravity.bak备份与agy二进制),在cli_sync.rs与droid_sync.rs全面替换可预测.tmp明文写入。(Ref #4039, Ref #4065, PR #4091, Thanks to @UnnamedPeople-Chin) - Shell/Batch/Env 转义、并发互斥与有界版本探测: 新增
utils::command::output_with_timeout(5 秒硬超时、Stdio::null()及超时分离管道线程防孙进程挂死)覆盖 CLI/Droid 的which/where/--version探测;为cli_sync.rs与droid_sync.rs补齐全局配置互斥锁(抽离sync_config_unlocked防恢复死锁)与 Droid 路径字符校验;对agy/agy.sh(POSIX 单引号转义)、agy.cmd、.env及.credentials.yaml消除命令/换行注入风险。(Ref #4039, Ref #4065, PR #4091, Thanks to @UnnamedPeople-Chin)
- 原子受限写入与安全恢复: 在
- [修复 Linux/macOS 轻量模式单实例唤起跨线程死锁] (Fixes #4093, PR #4094, Thanks to @fPip98):
- 全桌面端主线程异步投递单实例唤起: 将
lightweight::defer_on_main_thread条件编译扩展至全部桌面平台(not(target_os = "android")),在tauri_plugin_single_instance::init中移除平台分叉并统一异步投递exit_lightweight_mode到 UI 主线程执行,彻底消除 Linuxzbus与 macOS Tokio 非主线程同步建窗触发WindowStateCacheAB-BA 死锁及启动进程堆积问题,同时保持 Windows#3993语义不变。(Fixes #4093, PR #4094, Thanks to @fPip98)
- 全桌面端主线程异步投递单实例唤起: 将
What's Changed
- fix(proxy): derive background task model from orchestrator metadata and map gemini-3.1-flash-lite-preview by @fPip98 in #4085
- fix(security,cleanup): harden ciphertext auth, private file modes, loopback host-FS guards, and remove dead http_api (Ref #4039, Ref #4065) by @zainulhasan in #4086
- fix(security,sync): harden CLI and Droid credential writes, shell quoting, and version probes (Ref #4039, Ref #4065) by @UnnamedPeople-Chin in #4091
- fix(app): dispatch single-instance lightweight reopen onto main thread on all desktop platforms by @fPip98 in #4094
New Contributors
- @UnnamedPeople-Chin made their first contribution in #4091
Full Changelog: v5.0.5-beta.3...v5.0.5-beta.4