跳到正文
Hacker News (official RSS)(github.com)·· 2 小時前品質評分53

Google Antigravity CLI 1.5.17 使用自訂 AI 助理時,Gemini 配額消耗變成 4 倍

Google Antigravity ACP using "custom-agent" consumes 4x quota per token

重點導讀

有使用者回報,Antigravity CLI 1.5.17 搭配自訂 AI 助理時,Gemini 配額消耗比 1.5.16 多出 4 倍。

  • 回報者用相同模型和提示詞測試,並比對模型實際使用的 token 數。
  • 結果顯示,差異只出現在加上自訂 AI 助理的用法,預設 AI 助理在兩個版本的配額消耗率相同。測試沒有使用工具,也沒有觸發安全檢查或載入其他對話。這是 GitHub 上的使用者回報,內容未確認官方是否認定為錯誤,也沒有提供修補版本或暫時處理方式。

AI 伴隨問答

自備 Key 深度分析

針對這篇報導有疑問?可直接點選快捷問題或向 AI 追問背景脈絡與技術細節:

正文

Description

@mascarenhas

Antigravity CLI Version

1.5.17 (regressed vs 1.5.16)

Environment Context

  • OS: Linux x86_64 (Fedora 45)
  • Shell: bash
  • Terminal Emulator: not applicable (reproduced via headless agy acp stdio client)
  • Runtime Version: Antigravity CLI 1.5.16 vs 1.5.17 (consumer OAuth plan, Gemini Models)
  • Hardware Details: x86_64 desktop, single isolated process per run (no concurrent sessions)

Steps to Reproduce

Summary

Starting in agy 1.5.17, running agy acp --agent <custom-agent> consumes exactly 4.00× Gemini weekly and 5-hour quota per token compared to 1.5.16 on the exact same custom agent, model, and prompt. On the default agent (agy acp without --agent), 1.5.16 and 1.5.17 consume the exact same quota per token. Nothing in the 1.5.17 release notes mentions a 4× multiplier for custom agents.

Minimal reproduction

  1. Create an empty directory with a .git/ folder and a minimal custom agent (no tools, minimal 1-line prompt) at .agents/agents/notools-custom.md:
    ---
    name: notools-custom
    description: Minimal custom agent with no tools
    mainAgent: true
    subagent: false
    tools: []
    inheritCustomizations: false
    excludeDefaultComponents: true
    ---
    You are a terse assistant. Answer directly.
  2. Check baseline quota until two consecutive reads agree:
    AGY_CLI_DISABLE_AUTO_UPDATE=1 agy -p "/usage" --output-format json
    Record remaining_fraction for gemini-weekly and gemini-5h under Gemini Models.
  3. Run one turn against agy acp --agent notools-custom with Gemini 4 Neon (XHigh) using a minimal stdio ACP client (initialize → authenticate → session/new with mcpServers: [] and no _meta → session/set_model → session/prompt, then exit):
    import json, os, subprocess, sys, threading
    
    binary, work, prompt = sys.argv[1], sys.argv[2], sys.argv[3]
    extra = sys.argv[4:]  # e.g. ["--agent", "notools-custom"]
    proc = subprocess.Popen(
        [binary, "acp", *extra], cwd=work,
        env={**os.environ, "AGY_CLI_DISABLE_AUTO_UPDATE": "1"},
        stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
        text=True, bufsize=1,
    )
    results, lock, nid = {}, threading.Condition(), [0]
    
    def send(obj):
        proc.stdin.write(json.dumps(obj) + "\n")
        proc.stdin.flush()
    
    def req(method, params):
        nid[0] += 1
        rid = nid[0]
        send({"jsonrpc": "2.0", "id": rid, "method": method, "params": params})
        with lock:
            while rid not in results:
                lock.wait(timeout=300)
            return results.pop(rid)
    
    def reader():
        for line in proc.stdout:
            msg = json.loads(line)
            if "method" in msg and "id" in msg:
                send({"jsonrpc": "2.0", "id": msg["id"], "error": {"code": -32601, "message": "unsupported"}})
            elif "id" in msg:
                with lock:
                    results[msg["id"]] = msg
                    lock.notify_all()
    
    threading.Thread(target=reader, daemon=True).start()
    try:
        init = req("initialize", {"protocolVersion": 1, "clientCapabilities": {"fs": {"readTextFile": False, "writeTextFile": False}, "terminal": False}})
        methods = (init.get("result") or {}).get("authMethods") or []
        if methods:
            req("authenticate", {"methodId": methods[0]["id"]})
        res = req("session/new", {"cwd": work, "mcpServers": []})["result"]
        sid = res["sessionId"]
        pick = next(m["modelId"] for m in res["models"]["availableModels"] if "Neon (XHigh)" in m["name"])
        req("session/set_model", {"sessionId": sid, "modelId": pick})
        req("session/prompt", {"sessionId": sid, "prompt": [{"type": "text", "text": prompt}]})
        print("session:", sid)
    finally:
        proc.terminate()
        proc.wait(timeout=10)
    Prompt used (with a fresh UUID nonce per run to avoid caching):

    Nonce <uuid>. List the first 25 prime numbers, give their sum, and state in one sentence why 1 is not prime. Then stop.

  4. Re-read AGY_CLI_DISABLE_AUTO_UPDATE=1 agy -p "/usage" --output-format json until two consecutive reads agree, and compare the quota delta against the token usage recorded in ~/.gemini/antigravity-cli/conversations/<session>.db (gen_metadata).
  5. Repeat step 2–4 with agy 1.5.16 vs 1.5.17, and as a control without --agent (default agent).

Expected Behavior

A custom agent with no tools and a minimal prompt should draw Gemini quota at the same per-token rate in 1.5.17 as in 1.5.16 and as the default agent (~$6.00 API-equivalent per weekly percentage point on Gemini 4 Neon).

Actual Behavior / Error Screenshots

In 1.5.17, --agent notools-custom draws exactly 4.00× the Gemini weekly and 5-hour quota per token compared to 1.5.16 and compared to the default agent in 1.5.17.

Normalizing each run by native Neon token usage at API rates ($3/M uncached input, $15/M output; 0 cached tokens on fresh sessions):

Run agy version agentScript streamGenerateContent calls Native Neon tokens (in / out) API equiv. ($) Weekly Δ (pp) 5h Δ (pp) $/weekly pp Relative burn
agy acp --agent notools-custom 1.5.16 true 2 740 / 2,441 (2,307 thinking + 134 resp.) $0.038835 0.006470 pp 0.025886 pp $6.0022 1.00×
agy acp --agent notools-custom 1.5.17 true 2 737 / 3,066 (2,924 thinking + 142 resp.) $0.048201 0.032133 pp 0.128532 pp $1.5001 4.001×
agy acp (default agent, run 1) 1.5.16 false 2 12,007 / 2,868 $0.079041 0.013173 pp 0.052696 pp $6.0004 1.00×
agy acp (default agent, run 2) 1.5.16 false 2 12,009 / 2,741 $0.077142 0.012857 pp 0.051421 pp $6.0001 1.00×
agy acp (default agent, run 1) 1.5.17 false 2 12,001 / 3,317 $0.085758 0.014293 pp 0.057173 pp $5.9999 1.00×
agy acp (default agent, run 2) 1.5.17 false 2 12,003 / 3,014 $0.081219 0.013536 pp 0.054145 pp $6.0001 1.00×

Notes:

Logs & Configurations

Relevant lines from ~/.gemini/antigravity-cli/log/acp-server-*.log for the two --agent notools-custom runs:

1.5.16:

Language server version: 1.5.16
Creating new cascade trajectory (agentScript=true)
# Exactly 2 streamGenerateContent calls in the log; 0 monitor calls; 0 resumes.

1.5.17:

Language server version: 1.5.17
Creating new cascade trajectory (agentScript=true)
# Exactly 2 streamGenerateContent calls in the log; 0 monitor calls; 0 resumes.

Agent file (.agents/agents/notools-custom.md):

---
name: notools-custom
description: Minimal custom agent with no tools
mainAgent: true
subagent: false
tools: []
inheritCustomizations: false
excludeDefaultComponents: true
---
You are a terse assistant. Answer directly.

Reacted by Brian Grablin, Frank Vitale, sywd1118, sssysy, Lasse Räty, mary, Ievgen Pyrogov, Matias Iseas and Stanisław Pitucha

讀者討論

理性交流 · 即時討論