- [Eradicating Linux Window Focus Hijacking & Separating CLI Token Sync] (Fixes #3728, Thanks to @bkspi):
- Completely Prohibited Dynamic Process Execution for Version Probing: Removed the fallback invocation of
Command::new(exe_path).arg("--version")on Linux. For Electron desktop applications that do not cleanly terminate on--version, running the binary triggered single-instance IPC handlers that forcibly restored and focused the existing window every few seconds (or auto-started the app when closed). Replaced with strictly safe static metadata inspection. (Fixes #3728, Thanks to @bkspi) - Symlink Resolution & In-Memory asar Parsing: Automatically resolves symlinks via
fs::canonicalizeto locate the true installation root across standard Linux paths (/opt/Antigravity/,/usr/share/, etc.) forresources/app/package.jsonandproduct.json. Implemented a lightweight in-memoryextract_version_from_asar_bytesparser for asar-bundled assets, safely falling back to defaults on failure without ever spawning external processes. (Fixes #3728) - 60-Second In-Memory Version Caching: Introduced a global in-memory cache with a 60-second TTL (
VERSION_CACHE) inget_antigravity_version_with_path, completely eliminating disk I/O churn caused by frequent frontend polling and window focus events. (Fixes #3728) - Decoupled Classic App Switches from Overwriting CLI Credentials: Added an explicit
sync_agy_cliflag towrite_to_file_credentials. Switching the Classic desktop edition now strictly updates the system keyring and generic credentials without clobbering~/.gemini/antigravity-cli/antigravity-oauth-token, ensuring CLI credentials remain isolated unless explicitly switching the CLI client. (Fixes #3728) - Target-Isolated Client Status Fallback: Hardened
detect_active_clients_statusso that if a client cannot be directly matched against the system keyring, it falls back to its own tracked target ID (current_classic_account_id/current_agy_account_id/current_ide_account_id) instead of returningNone, preventing frontend UI fallbacks from displaying the same global account across multiple clients. (Fixes #3728)
- Completely Prohibited Dynamic Process Execution for Version Probing: Removed the fallback invocation of
- [Full Compatibility for Gemini Protocol URL Query (?key=) Authentication] (Fixes #3729, Thanks to @Ran-Xing):
- Supported Standard URL Query API Key Extraction: Resolved an issue where Google Gemini official standard REST requests and third-party clients (e.g. Cherry Studio) passing credentials via URL query parameters (e.g.
?key=YOUR_API_KEYor?alt=sse&key=...) were erroneously blocked with401 Unauthorizeddue to header-only validation. Refactored theextract_api_keycredential extraction pipeline to seamlessly supportAuthorization: Bearer,x-api-key,x-goog-api-key, and URL query?key=. (Fixes #3729, Thanks to @Ran-Xing) - Unified User Token Extraction in Disabled Auth Mode: Extended the universal credential extraction pipeline to
auth_mode = Off, ensuring User Token identities and usage metrics are accurately extracted and recorded regardless of whether credentials are provided via HTTP headers or Gemini standard URL queries. (Fixes #3729)
- Supported Standard URL Query API Key Extraction: Resolved an issue where Google Gemini official standard REST requests and third-party clients (e.g. Cherry Studio) passing credentials via URL query parameters (e.g.
- [Complete In-Memory Hot-Reload for "Only Expose Raw Quota Models" in Web/Headless Mode] (Fixes #3730, Thanks to @Ran-Xing):
- Restored In-Memory Hot-Reload for Web Config Save: Fixed an issue in Web / Headless (VPS) environments where saving settings via
admin_save_configomitted acquiring the write lock foronly_raw_quota_models, preventing changes to "Only expose raw quota models" from taking immediate effect on/v1/modelswithout a server restart. (Fixes #3730, Thanks to @Ran-Xing) - Full Alignment with Desktop Hot-Reload Pipelines: Parity-aligned Web mode with Desktop by integrating hot-reload updates for
debug_logging,upstream.set_user_agent_override,monitor.set_capture_health_logs,hub_versionfingerprinting, and upstream proxy / proxy pool client cache invalidation. (Fixes #3730)
- Restored In-Memory Hot-Reload for Web Config Save: Fixed an issue in Web / Headless (VPS) environments where saving settings via
- [Linux 窗口抢占置顶与自动拉起根治,并隔离 CLI 凭证同步] (Fixes #3728, Thanks to @bkspi):
- 彻底禁止动态进程执行探测版本: 在 Linux 环境下移除对外部可执行文件执行
Command::new(exe_path).arg("--version")的兜底逻辑;针对 Electron 桌面应用在接收到--version参数时不会静默退出,而是触发single-instance机制向正在运行的主实例发送 IPC 消息导致主窗口每数秒被强制恢复并置于最前台抢占焦点、或在客户端关闭时意外启动新实例的致命缺陷,全面改为安全的静态文件与元数据检测。(Fixes #3728, Thanks to @bkspi) - 多路径符号链接穿透与 asar 内存解析: 自动通过
fs::canonicalize解析符号链接定位到可执行文件真实物理安装根目录,覆盖 Linux 标准安装路径(/opt/Antigravity/、/usr/share/等)下的resources/app/package.json与product.json;并针对打包于 asar 内的场景实现轻量内存解析器extract_version_from_asar_bytes,探查失败时安全降级默认值,从物理层面杜绝任何外部进程唤醒。(Fixes #3728) - 版本探查 60 秒全局内存缓存: 在
get_antigravity_version_with_path引入带有 60 秒 TTL 的内存缓存(VERSION_CACHE),彻底消除前端轮询与窗口焦点切换时对磁盘版本文件的高频 I/O 探查损耗。(Fixes #3728) - 解除经典款切号对 CLI 专属凭证的覆写覆盖: 为
write_to_file_credentials引入sync_agy_cli显式控制开关;切换经典款应用时仅维护钥匙串与通用凭证,严禁盲目冲刷~/.gemini/antigravity-cli/antigravity-oauth-token;仅在显式切换 CLI 时同步更新 CLI 凭证文件,杜绝切经典款冲掉 CLI 独立账号的冲突问题。(Fixes #3728) - 补全多端账号生效探测的回退隔离: 优化
detect_active_clients_status,当某一客户端未在钥匙串直接匹配时,优先回退到该客户端专属记录的目标账号 ID(current_classic_account_id/current_agy_account_id/current_ide_account_id),杜绝因返回None导致前端错误回退到全局最后切换的账号而造成“一个变另一个也跟着变”的视觉联动。(Fixes #3728)
- 彻底禁止动态进程执行探测版本: 在 Linux 环境下移除对外部可执行文件执行
- [Gemini 协议 URL Query (?key=) 授权鉴权全面兼容] (Fixes #3729, Thanks to @Ran-Xing):
- 支持标准 URL Query 传参提取 API Key: 针对 Google Gemini 官方标准 REST 协议及第三方客户端(如 Cherry Studio 等)通过 URL Query 参数(例如
?key=YOUR_API_KEY或?alt=sse&key=...)传参调用代理时,因中间件仅检查 HTTP Header 而被误判拦截为401 Unauthorized的问题,重构extract_api_key鉴权凭证提取管道,完整覆盖Authorization: Bearer、x-api-key、x-goog-api-key及 URL Query?key=。(Fixes #3729, Thanks to @Ran-Xing) - 统一免鉴权模式下的 User Token 识别: 在
auth_mode = Off模式下同步接入通用凭证提取管道,确保无论通过 Header 还是 Gemini 标准 URL Query 传参,均能准确提取并记录 User Token 身份与其调用用量。(Fixes #3729)
- 支持标准 URL Query 传参提取 API Key: 针对 Google Gemini 官方标准 REST 协议及第三方客户端(如 Cherry Studio 等)通过 URL Query 参数(例如
- [Web/Headless 模式保存配置补全「仅暴露真实配额模型」等内存热更新] (Fixes #3730, Thanks to @Ran-Xing):
- 补齐 Web 配置保存状态热更新: 针对 Web 网页端 / Headless(无头 VPS)服务在管理接口
admin_save_config保存配置时,因遗漏写锁同步only_raw_quota_models导致用户开关「仅暴露真实配额模型」后/v1/models等接口未能即时生效、必须重启进程的缺陷,完整补齐only_raw_quota_models内存写锁同步。(Fixes #3730, Thanks to @Ran-Xing) - 对齐桌面端全量热重载链路: 同步补齐 Web 模式下对
debug_logging、upstream.set_user_agent_override、monitor.set_capture_health_logs、hub_version指纹以及上游代理和代理池底层 HTTP 客户端缓存热失效逻辑,确保 Web/Headless 环境与桌面 GUI 环境享有 100% 相同的高水准动态热重载体验。(Fixes #3730)
- 补齐 Web 配置保存状态热更新: 针对 Web 网页端 / Headless(无头 VPS)服务在管理接口
Full Changelog: v4.9.9-beta.8...v4.9.9-beta.9