#13852·t3code

Usage page shows $0 and the desktop app keeps reconnecting while getUsageSummary reads Antigravity history

Author: rabesssCreated Sep 26, 2026Updated Sep 27, 2026
Labelsbugacceptedvia-triage

What happened

The Usage page in the desktop app shows $0, although it showed my data before. While it loads, the app shows " is reconnecting" (the placeholder stands for the machine's hostname). Both started after updating from 0.0.43-nightly.20260924.2223 to the Sep 25/26 nightlies.

Diagnosis

server.getUsageSummary blocks the server's event loop for seconds at a time. Most of that time is spent in the Antigravity usage reader added in #10409 (apps/server/src/usage/antigravityUsageReader.ts, unchanged on main since).

  • A CPU profile of one isolated server (same build, fresh base dir, warm usage scan cache, two sequential requests of 17.8 s and 18.0 s) shows:
    • The top self-time is readMetadata, at 10.2 s. parseOpenCodeMessage and readOpenCodeUsage come next at about 1.25 s combined.
    • The three longest uninterrupted main-thread stretches are 3.0 s, 2.2 s and 2.1 s, all in readMetadata/readDatabase.
  • The setImmediate every 256 rows in readMetadata doesn't bound the blocking. Antigravity gen_metadata/steps rows are large blobs, and node:sqlite iterate() reads them synchronously.
  • readAntigravityUsage has no per-file cache, unlike the transcript reader's size/mtime cache. Every request reopens and decodes every .db under the Antigravity roots, including files whose mtime is older than sinceMs.
  • Concurrent getUsageSummary calls don't share one in-flight scan. The desktop backend's trace shows three full scanSummary runs starting in the same second.
  • Put together, this becomes a reconnect loop:
    1. A scan stalls the loop, and trivial GET /.well-known/t3/environment requests take 3.5–11.4 s instead of ~2 ms.
    2. The desktop's ConnectionDriver.connect times out at 15 s, and the banner shows "reconnecting".
    3. The reconnect issues another getUsageSummary.
    4. The in-flight requests are interrupted, and the page renders $0. The scan cache holds ~60k records, and a direct request returns 302 buckets.
  • Possible directions:
    • Cache Antigravity and OpenCode results per file by size/mtime.
    • Skip Antigravity .db files older than the window.
    • Read SQLite off the main thread; the Claude history reader already uses a worker.
    • Share a single in-flight scan across concurrent calls.

Steps to reproduce

  1. On Linux, have a large Antigravity CLI history in ~/.gemini/antigravity-cli/conversations. Here it's 211 .db files totalling ~11 GB, the largest ~306 MB, the newest written 2026-09-10.
  2. Run a nightly containing #10409 (first seen in 0.0.43-nightly.20260925.2269).
  3. Open the Usage page in the desktop app. It stays loading, the host shows "reconnecting", and the page ends at $0.
  4. Or, with no UI involved: start t3 serve with a fresh --base-dir, issue a session with t3 auth session issue, and call server.getUsageSummary (29-day window) over /ws while polling /.well-known/t3/environment. Each call takes ~18 s, and the polls stall for over 1 s.

Version

0.0.43-nightly.20260926.2282. The first affected build is 0.0.43-nightly.20260925.2269; the last good one is 0.0.43-nightly.20260924.2223.

Environment

Arch Linux x86_64, kernel 7.1.3-zen, desktop app (Electron 44.4.2), NVMe SSD, 32 GB RAM. The history sources are:

  • Antigravity CLI: 211 dbs, ~11 GB
  • OpenCode: 161 MB db plus 19,851 message JSON files
  • Codex: 21 GB, 6,230 files
  • Grok: ~20.9k files
  • Claude: 355 MB

Evidence

bash
# desktop backend server.trace.ndjson, UTC
15:24:36Z UsageService.scanSummary 189817ms   ws.rpc.server.getUsageSummary 189839ms
15:30:29Z scanSummary 37333 / 39815 / 45903ms (3 concurrent), 3x getUsageSummary Interrupted at 18.9s
15:34:37Z scanSummary 68543 / 70463 / 77668ms (3 concurrent), 1x Interrupted
15:25:32Z-15:27:15Z ConnectionDriver.connect 15000ms status.interrupted=true (x4)
http.server GET /.well-known/t3/environment 3513-11406ms during scans (normally 1-4ms)
RpcClient.server.getUsageSummary: RpcClientError: SocketOpenError: timeout waiting for "open"

# isolated CPU profile, self time (2 requests)
10230 ms  readMetadata          (antigravityUsageReader)
  808 ms  parseOpenCodeMessage
  445 ms  readOpenCodeUsage
longest blocked stretches: 3039ms readMetadata, 2151ms readMetadata, 2140ms readMetadata

Related issues

#7088 is the same class of problem, an unbounded usage scan blocking the server, but it comes from a different source (the ~/projects fallback and the Codex transcript volume). The Antigravity reader didn't exist when it was filed. I found no existing issue about Antigravity usage reads, Usage showing $0 on current nightlies, or reconnects caused by the usage scan.

Fix applied or workaround

Nothing has been changed on the machine. Moving old Antigravity conversations out of ~/.gemini/antigravity-cli/conversations should avoid it, at the cost of that history.

Filed by

Claude Code (claude-opus-5-5), investigating on the user's machine and following .github/triage/PLAYBOOK.md.