Skip to content

v1.3.0 — native adaptive ModeAuto on xhigh, continuous SSE heartbeat, output telemetry

Choose a tag to compare

@testAccountDeltas testAccountDeltas released this 13 Oct 15:12
· 3 commits to main since this release

Why this release

Under real-world workloads, Google Antigravity / Borg TPU infrastructure experiences queue and scheduling spikes resulting in TTFT (time-to-first-token) pauses of 30s to 66s. Without keepalive frames on the wire, client socket timeouts (in Node.js/undici) trigger silent connection drops (BrokenPipeError: [Errno 32] Broken pipe in the proxy when upstream finally replies). Furthermore, hardcoding budget limits on the gateway's adaptive tiered models (gemini-3.8-flash-tiered) disabled Google's native ModeAuto thinking logic, forcing excessive reasoning on trivial turns while hiding actual token usage.

This release eliminates BrokenPipeError entirely, unlocks Google's native dynamic reasoning, and adds transparent reasoning telemetry.

Native adaptive thinking on /effort xhigh

  • gemini-3.8-flash-tiered without bracket suffixes now routes cleanly to Google Antigravity ModeAuto (thinkingBudget = -1). When no artificial token cap (like (16384)) is attached, the model itself dynamically evaluates task complexity: spending zero reasoning tokens on routine file reads and scaling to deep reasoning on architectural analysis.
  • Dynamic -tiered model resolver: Claude Code's /effort setting dynamically selects the underlying backend model:
    • low → *-low(2048)
    • medium → *-medium(8192)
    • high → *-high(16384)
    • xhigh / max → clean gemini-3.8-flash-tiered (ModeAuto).
  • Default effortLevel in settings.json and setup-agent.py is now set to xhigh.

Continuous SSE Keepalive Ping Heartbeat (fixes BrokenPipeError)

  • Automatic event: ping ticker (5.0s interval) keeps the client connection alive across long Borg queue waits and heavy reasoning spikes.
  • Continuous across the entire stream: unlike simple TTFT-only guards, the idle timer resets on every received chunk and keeps running mid-stream. If generation pauses mid-response, keepalive frames continue to flow. Thread-safe lock (wfile_lock) ensures ping events and response frames never collide.
  • Tested and verified live under upstream delay simulations and real 30s+ Borg spikes (pings=4, zero connection drops).

Granular output telemetry & hidden reasoning accounting

  • Proxy logging now decomposes total output into visible vs hidden tokens:
    out_tok=3439(vis~1835,hid~1604)
    • vis (visible tokens): estimated tokens across generated text (text_chars), streamed reasoning (think_chars), and tool call JSON (tool_chars).
    • hid (hidden tokens): internal Borg/TPU reasoning tokens accounted for by Google's usageMetadata (thoughtsTokenCount) that are not streamed as visible deltas.
  • Logs include accurate character counts (think_chars, text_chars, tool_chars) and ping counts (pings=N).
  • Fixed capture of message_delta frames to ensure terminal usage and stop_reason (end_turn/tool_use) are consistently recorded.

Upgrading

python setup-agent.py

Safe to re-run on an existing install.