github lbjlaq/Antigravity-Manager v5.0.4-beta.7
Antigravity Tools v5.0.4-beta.7

pre-releaseone hour ago
  • [Upstream WAF 429 Identity Sanitization, Request-Level Anti-Cascade & Prompt Rewrite Rules] (Fixes #3904, #3908, #3901, #3915, Ref #3903, #3912, PR #3913, Thanks to @jeikl, @lbjlaq, @sinderson123-afk):
    • Singleton Identity Invariant & Multi-Identity Deduplication: Enforced global deduplication across systemInstruction.parts, retaining only the primary official Antigravity identity. Thoroughly stripped pure whitespace and duplicate identity declarations injected by clients such as DSH, pi, and OpenCode, preventing upstream Google WAF from rejecting mixed identity prompts with 429 RESOURCE_EXHAUSTED when tools are present. (Fixes #3904, #3908)
    • Version Token Matching & Appositive Normalization: Prioritized multi-segment version tokens (e.g. gemini-3.8-flash-low, eliminating truncation to gemini-3 and leftover 8-flash-low model.). Normalized ASCII comma appositives following Antigravity identity declarations to periods (AG, a coding agent harness. $\to$ AG. a coding agent harness.) and folded malformed punctuation sequences (e.g. .,, 。,), removing upstream WAF triggers. (Fixes #3908, #3915)
    • Request-Level 429 Isolation & Configurable Grace Retry: Refined failure count tracking to account + model granularity, preventing single-model rate limits from locking the entire account. Introduced in-place GraceRetry without account lockout on initial attempt for request-level 429s without retryDelay. Added request_429_grace_ms (default 1500ms, range 200–10000ms, configurable via UI/config and ABV_REQUEST_429_GRACE_MS environment variable with hot reload). Returned 429 all_accounts_limited with gateway_error.source when the entire gateway pool is cooling down, and aligned structured QuotaFailure / RetryInfo / ErrorInfo signals across rotation and retry policies. (Fixes #3901)
    • WAF Prompt Cleanup Rules (Prompt Rewrite) & Recommended Presets: Added the "Prompt Rewrite Rules" configuration section and modal editor under API Proxy settings. Supports single-line * wildcard matching and \n/\r/\t/\\/\* escape sequences (empty replacement deletes matches), operating strictly on the System track prior to the first real user message while exempting code blocks and thinking blocks. Seeded 6 battle-tested recommended preset rules (OpenCode appositive, DSH identity, WorkBuddy identity, Codex CLI fingerprint, Anthropic Billing header metadata, etc.) with one-click loading and config export/import. (Ref #3903, #3913)
    • Full 12-Locale i18n & Multi-Binary Cargo Build Fix: Completed full internationalization across all 12 supported languages for prompt rewrite and retry grace settings. Explicitly declared default-run = "antigravity-tools" in Cargo.toml, resolving binary ambiguity errors during cargo run and tauri dev. (Ref #3913)
  • [Converge Upload Timeout Policy & Eliminate 504 Cross-Account Replay Amplification] (PR #3906, Ref #3763, #3821, #3639, #3893, #3899, Thanks to @jeikl, @mclinyeshi, @JeikCode):
    • Progress-Driven Upload Watchdog: Downgraded upload_budget from a hard deadline to a soft observational budget; only terminates uploads with UploadStalled after continuous stall_secs without transmission progress, backed by a global budget hard cap to prevent aborting active large transfers on slow connections. (PR #3906, Ref #3763)
    • Eradicate Cross-Account Replay Amplification: Wired Upload and UploadStalled into TerminalDisposition::plan. In all text routing modes (CacheFirst / Balance / PerformanceFirst), upload failures retry once in place on the same account before stopping permanently—strictly avoiding unbinding sticky sessions or replaying large request bodies across secondary pool accounts. (PR #3906, Ref #3899)
    • Large Body Byte Threshold & Endpoint Routing Alignment: Corrected large_body classification to rely purely on byte length (>= 2MB) rather than token >= 30k approximations; prioritized healthy Sandbox endpoints when Daily is cooling down, properly tagging terminal states at endpoint boundaries. (PR #3906)
    • EWMA Transfer Rate Sampling & Pipeline UA 404 Short-Circuit: Lowered EWMA sampling threshold from 32KB/s to 4KB/s and sampled aborted/failed uploads to track slow networks realistically. Unified outdated User-Agent 404/403 short-circuiting in the pipeline to prevent spurious 900s model-breaker lockouts. (PR #3906)
    • Timeout Config Parity & Effective Values Panel: Dynamically aligned frontend timeout calculation formulas (1 + extra_wait_ratio) and clamped input ranges to backend schemas; introduced get_effective_timeout_config and a live "Effective Settings" inspector in the settings panel. (PR #3906)
    • Policy Documentation & Structured Telemetry: Authored docs/UPLOAD_TIMEOUT_POLICY.md detailing timeout matrix, migration, and rollback strategies. Added structured metrics including progress_pct, upload_budget_extended, and endpoint_attempts. (PR #3906)
  • [Sticky Session Transport Reset In-Place Retry & KV Cache Preservation] (PR #3899, Ref #3821, #3893, #3639, Thanks to @mclinyeshi):
    • Distinguish Transport Resets from First-Byte Timeouts: Accurately separated intra-budget TCP connection drops (e.g. Daily endpoint client error (SendRequest)) from genuine first-byte timeouts, classifying in-budget resets as TransportReset (HTTP 502) without penalizing or locking accounts. (PR #3899, Ref #3821)
    • In-Place Retry Under CacheFirst to Protect KV Cache: Guaranteed that CacheFirst mode never unbinds accounts on TransportReset, retrying in place once to keep the session binding intact and prevent upstream KV cache (prompt cache) drops caused by unexpected mid-session account drift. Balance mode retries once in place before failing over. Non-cached image generation requests under CacheFirst are allowed to rotate to another account on failure without unbinding the session's primary text binding. (PR #3899)
  • [Sanitizer Punctuation Continuation Protection] (PR #3902, Ref #3508, Thanks to @ThermalEng, @jeikl):
    • Normalized Punctuation Splicing on Identity Continuation: Only stripped the trailing period of the official identity declaration when immediately followed by a comma continuation, preventing ".," double-punctuation artifacts while preserving the terminal period on standalone declarations. Added robust regression tests for full-width commas and known client openings. (PR #3902, Ref #3508)
  • [OpenAI Prompt Pass-Through Integrity & Legacy Skill Instructions Cleanup] (Fixes #3914, Thanks to @l10kai):
    • Eliminate Legacy Skill Prompt Hijacking: Completely removed the legacy enhance_gemini_skills_prompt hardcoded logic, ceasing unconditional interception of </skills> and </skills_instructions> XML tags under OpenAI-compatible endpoints (/v1/chat/completions and /v1/responses). Eliminated erroneous pseudo-instructions injecting fictitious shell_command tools and Windows PowerShell commands into non-Codex clients, fully restoring verbatim prompt pass-through and preventing tool-call hallucinations and conflicting instructions across agent frameworks (Oh My Pi, Cline, Roo Code, etc.). (Fixes #3914)
  • [Stream Lifecycle EOF Trailing Buffer Prioritized Flush & Spurious Interruption Fix] (Fixes #3911, Ref #3693, Thanks to @djj532):
    • Prioritized Safe Flush for Trailing EOF Buffer: Reordered stream lifecycle execution (stream_lifecycle.rs) at upstream EOF and loop break points to safely flush and dispatch pending trailing buffers prior to !has_content() guard evaluation. Completely resolved the defect where trailing content or tool-call frames lacking terminal newlines (\n) following thinking blocks (thought=true) were held in the line buffer, prematurely triggering upstream stream ended after thinking without content and dropping valid terminal chunks. Retained strict error propagation when flushed buffers yield no content, preserving native client retry semantics. (Fixes #3911, Ref #3693)

  • [上游 WAF 429 身份改写根治、请求级限流防连坐与风控提示词清理方案] (Fixes #3904, #3908, #3901, #3915, Ref #3903, #3912, PR #3913, Thanks to @jeikl, @lbjlaq, @sinderson123-afk):
    • 单例身份不变量与多重身份清理: 跨 systemInstruction.parts 全局去重,仅保留首处官方 Antigravity 身份;彻底清除 DSH/pi/OpenCode 等客户端多重身份声明叠加生成的纯空白与重复身份片段,杜绝多身份混合带 tools 时被 Google WAF 判定异常并抛出 429 RESOURCE_EXHAUSTED。(Fixes #3904, #3908)
    • 版本号识别优化与同位语标点规整: 版本 token 优先匹配完整版本号(如 gemini-3.8-flash-low,彻底根除被截断为 gemini-3 并残留 8-flash-low model. 的缺陷);规范化 AG 声明后的 ASCII 逗号与同位语续写为句号(AG, a coding agent harness. $\to$ AG. a coding agent harness.),折叠处理畸形标点(如 .,、。,),消除上游 WAF 触发特征。(Fixes #3908, #3915)
    • 请求级 429 防连坐与智能宽限重试: 失败计数粒度细化至账号+模型(account + model),避免单一模型限流波及全号;首轮 429 遭遇无 retryDelay 的请求级限流时原地执行 GraceRetry 且不锁定账号;新增 request_429_grace_ms(首轮请求 429 宽限延迟,默认 1500ms,范围 200–10000ms,支持环境变量 ABV_REQUEST_429_GRACE_MS 与热更新);网关全池冷却规范返回 429 状态码与 all_accounts_limited,并通过 gateway_error.source 标明来源;优先解析 QuotaFailure、RetryInfo、ErrorInfo 结构化信号,与轮换策略协同。(Fixes #3901)
    • 风控提示词清理方案(Prompt Rewrite)与内置推荐预设: 反代设置新增「风控提示词清理方案」配置与编辑面板,支持单行通配符 * 与 \n/\r/\t/\\/\* 转义,空替换即为删除,仅作用于首个真实 user 之前的 System 轨并豁免代码块与思考块;默认内置并支持一键载入 6 套实战推荐规则(OpenCode 同位语、DSH 身份声明、WorkBuddy 身份声明、Codex CLI 身份指纹、Anthropic Billing 计费头元数据等),支持规则热重载与配置导入导出。(Ref #3903, #3913)
    • 全语言国际化覆盖与多目标编译修复: 针对提示词清理规则与宽限延迟等新配置项补齐 12 种语言完整国际化覆盖;在 Cargo.toml 中显式指定 default-run = "antigravity-tools",彻底消除多 bin 目标时 cargo run 或 tauri dev 编译报错问题。(Ref #3913)
  • [收敛上传超时策略并消除 504 跨账号重传放大] (PR #3906, Ref #3763, #3821, #3639, #3893, #3899, Thanks to @jeikl, @mclinyeshi, @JeikCode):
    • 进展驱动上传看门狗: 将 upload_budget 从固定硬时间切断降级为软预算与观测指标,仅在连续 stall_secs 无任何数据传输进展时才触发 UploadStalled 终态中止;全局总预算兜底硬上限,彻底避免网络平稳但速度较慢的大文件/大上下文上传被中途误掐断。(PR #3906, Ref #3763)
    • 杜绝跨账号重传放大: 全面接入 TerminalDisposition::plan,明确 Upload 与 UploadStalled 在所有文本调度模式(CacheFirst / Balance / PerformanceFirst)下仅允许在同账号原地重连重试 1 次,失败后直接终止(Stop),坚决不解绑粘性会话、不跨账号轮换重放同一份大请求体,彻底消除 504 导致的号池风暴与雪崩。(PR #3906, Ref #3899)
    • 端点调度与 large_body 字节判定优化: 修正 large_body 判定,仅依据实际 Body 字节数(>= 2MB)触发,移除 >= 30k tokens 的误判;主端点冷却时大请求优先尝试健康的 Sandbox 端点,且端点遍历至末尾时严格打齐终态标记。(PR #3906)
    • EWMA 传输速率采样放宽与 UA 404 短路保护: EWMA 有效速率采样门槛从 32KB/s 宽限至 4KB/s,并在失败/中止的上传上正常采样以更贴近真实弱网环境;客户端 UA 过旧引发的 404/403 在 Pipeline 统一短路,不再误写 900 秒模型熔断与换号。(PR #3906)
    • 前后端超时配置与生效值面板对齐: 超时配置公式动态对齐后端(1 + extra_wait_ratio),前端精确夹取后端取值范围;新增 get_effective_timeout_config 命令并在设置面板提供「当前生效值」展示,明确区分单端点尝试次数与跨账号重试。(PR #3906)
    • 策略文档与结构化观测落地: 新增 docs/UPLOAD_TIMEOUT_POLICY.md 详细阐释超时策略、终态矩阵、迁移与回滚路径;上传日志增加 progress_pct、upload_budget_extended、endpoint_attempts 等结构化指标。(PR #3906)
  • [粘性会话连接重置原地重试与缓存锁定保护] (PR #3899, Ref #3821, #3893, #3639, Thanks to @mclinyeshi):
    • 区分底层连接重置与首字超时: 准确区分预算内底层 TCP 连接中断(如 daily 端点 client error (SendRequest))与真正的首字超时,将预算内断流归类为 TransportReset(502)且不惩罚账号,避免被误判为超时故障。(PR #3899, Ref #3821)
    • CacheFirst 模式原地重试与会话缓存锁定: 在 CacheFirst 调度模式下遭遇 TransportReset 坚决不解绑账号,在原地重试 1 次并维持会话绑定,彻底根除长会话因瞬间断流漂移至其他账号导致昂贵的前缀预填充缓存(KV Cache)雪崩失效的问题;Balance 模式下原地重试 1 次失败后才触发换号容灾;CacheFirst 下生图请求(不携带 KV 缓存)遭遇故障时允许平滑轮换账号且不解绑会话原有的文本绑定。(PR #3899)
  • [身份改写标点清洗与续写保护] (PR #3902, Ref #3508, Thanks to @ThermalEng, @jeikl):
    • 规整身份声明后续标点拼接: 仅当官方身份声明紧跟逗号续写时才剥离末尾句号,彻底消除清洗后出现 ., 双标点异常,在非续写路径严格保留句号;强化全角逗号与已知客户端开场白的单元测试防御覆盖。(PR #3902, Ref #3508)
  • [OpenAI 协议提示词纯净透传与遗留技能伪指令清除] (Fixes #3914, Thanks to @l10kai):
    • 拔除遗留技能提示词劫持: 彻底移除 enhance_gemini_skills_prompt 硬编码逻辑,不再无条件劫持 OpenAI 兼容协议(/v1/chat/completions 与 /v1/responses)中的 </skills> 及 </skills_instructions> XML 标签;消除向非 Codex 客户端注入虚构的 shell_command 工具及 Windows PowerShell 命令的错误伪指令,彻底恢复系统提示词原样纯净透传,杜绝主流 Agent 客户端(Oh My Pi、Cline、Roo Code 等)发生指令冲突与工具调用幻觉。(Fixes #3914)
  • [流式生命周期 EOF 残余缓冲区优先冲刷与误中断消除] (Fixes #3911, Ref #3693, Thanks to @djj532):
    • EOF 残余缓冲区优先安全冲刷: 调整流式生命周期管理(stream_lifecycle.rs)在遇到上游 EOF 及跳出主循环时的执行顺序,优先对滞留的尾部数据缓冲区(buffer)执行 Trim 与行解析下发,彻底根治思考结束(thought=true)后紧跟的无换行符(\n)正文或工具调用尾帧因滞留缓冲区而被判空守卫(!has_content())提前拦截并报出 upstream stream ended after thinking without content 导致有效帧丢失的问题;冲刷后若确实无有效正文依然如实报错以触发原生重试,兼顾极端分片容错与故障重试契约。(Fixes #3911, Ref #3693)

What's Changed

  • fix(sanitizer): avoid doubled punctuation in identity continuation cause error 429 by @ThermalEng in #3902
  • fix(proxy): keep CacheFirst sticky account on transport reset and first-byte terminals (Ref #3821, #3893, #3639) by @mclinyeshi in #3899
  • test(sanitizer): harden identity continuation punctuation coverage (PR #3902, Ref #3508) by @jeikl in #3905
  • fix(proxy): 收敛上传超时策略并消除 504 重传放大 (Ref #3763, #3821, #3639, #3893, #3899) by @jeikl in #3906
  • fix(proxy,sanitizer): 修复 WAF 429 身份改写问题并新增风控提示词清理方案 by @jeikl in #3913

New Contributors

Full Changelog: v5.0.4-beta.6...v5.0.4-beta.7

Don't miss a new Antigravity-Manager release

NewReleases is sending notifications on new releases.