* feat(antigravity): add support for Antigravity IDE storage on Windows CodeBurn previously only detected Antigravity CLI usage (.pb files under .gemini/antigravity/). Antigravity IDE on Windows stores session state in VSCode-style storage at %APPDATA%\Antigravity IDE\User\globalStorage\state.vscdb, which was not detected. Add support for reading Antigravity IDE sessions from the VSCode-style storage: - Extend CONVERSATION_ROOTS to include APPDATA Antigravity IDE path - Refine path classification to properly identify IDE vs CLI sessions - Handle missing per-call timestamps by stamping file mtime as fallback - Bump CACHE_VERSION to 4 for cache invalidation Fixes: CodeBurn reports zero usage when Antigravity IDE is actively used. * fix(antigravity): stamp mtime fallback at emission, tighten path classification - Apply the mtime fallback to a copy at emission instead of mutating and persisting it into the cache, so a later file rewrite can't retro-date a session's history to the new mtime. SQLite gen_metadata rows have no real per-call time; the RPC path still uses chatStartMetadata.createdAt. - Drop the unreachable APPDATA classifier branch (discovery only walks the ~/.gemini roots; APPDATA state.vscdb holds no token usage). This also removes the misroute of base-antigravity paths under an "Antigravity IDE" profile dir. - Bump CACHE_VERSION to invalidate caches that persisted a synthesized mtime. * fix(antigravity): stabilize untimestamped call times across DB rewrites Extract ChatStartMetadata.created_at from proto-encoded data and decode multiple timestamp formats (ISO string, Timestamp submessage, unix varint). Implement assignStableTimestamps() to preserve first-seen timestamps across file rewrites, preventing retro-dating of sessions when .db files are modified. Make conversation roots dynamic (computed per call) to honor environment overrides in tests. Add comprehensive timestamp stability tests verifying that timestamps remain fixed across file mtime changes while respecting date-range filters. * test(antigravity): assert today range excludes first-seen timestamps Adds a test case to verify that the 'today' date range filter correctly excludes sessions based on their first-seen timestamp, not file modification time. This ensures that even if a database file is rewritten with a later mtime, sessions with earlier first-seen dates are properly filtered out. Refs #411
4.8 KiB
Antigravity
Google Antigravity (CLI and IDE). CodeBurn discovers session files on disk and queries the local language-server RPC endpoint to parse them.
- Source:
src/providers/antigravity.ts - Loading: lazy via
src/providers/index.ts. Lazy because the protobuf dependency is heavy. - Test: focused helper coverage in
tests/providers/antigravity.test.ts.
Where it reads from
CodeBurn discovers Antigravity sessions from local directories on disk, then queries the live language-server process (if running) to fetch detailed trajectory generator metadata:
- Session Discovery: It scans the following folders for
.pbor.dbfiles:- Antigravity CLI:
%USERPROFILE%\.gemini\antigravity-cli\conversations(andimplicit) - Antigravity App/older path:
%USERPROFILE%\.gemini\antigravity\conversations - Antigravity IDE:
%USERPROFILE%\.gemini\antigravity-ide\conversations(andimplicit). The IDE also maintains VSCode-style global state at%APPDATA%\Antigravity IDE\User\globalStorage\state.vscdb, but that DB stores trajectory metadata (titles, timestamps, workspace paths) — not token usage. Token usage data still comes from the.dbconversation files.
- Antigravity CLI:
- Language Server RPC Query: It locates the active language-server process via
pson POSIX orGet-CimInstance Win32_Processon Windows. It extracts the port and CSRF token from the process arguments, and queries the local HTTPS RPC endpointGetCascadeTrajectoryGeneratorMetadatato parse the session. - Cache Fallback: If the language server is not running, it falls back to the local results cache.
Antigravity exposes slightly different process flags across platforms:
POSIX builds have used --https_server_port and --csrf_token; Windows
builds can expose --extension_server_port and
--extension_server_csrf_token. Both space-separated and --flag=value
forms are supported. The parser identifies the target app type using the --app-data-dir flag (e.g., antigravity, antigravity-cli, or antigravity-ide).
For Antigravity CLI (agy), CodeBurn can also install an opt-in status line
hook with codeburn antigravity-hook install. The hook records the CLI's
sanitized context_window.current_usage payload while agy is still alive,
without prompts or local working-directory paths. It also attempts a best-effort
RPC snapshot for full response metadata. The installed command points at a
persistent codeburn binary from PATH rather than a local build artifact, and
running codeburn antigravity-hook install again repairs older CodeBurn-owned
statusLine commands that used stale absolute paths. Remove it with codeburn antigravity-hook uninstall; if --force replaced an existing statusLine
command, uninstall restores that previous command.
Storage format
Protobuf. Cascade and response objects map to ParsedProviderCall directly.
Caching
Custom file cache at $CODEBURN_CACHE_DIR/antigravity-results.json (defaults to ~/.cache/codeburn/). The cache is also used as the data source when the RPC endpoint is unavailable, not just as an optimization. Bumping the cache version forces a recompute.
Deduplication
Per <cascadeId>:<responseId> for RPC data. The status line fallback collapses
repeated identical usage snapshots, ignores singleton intermediate snapshots
when a later stabilized usage total is observed for the same conversation, and
uses positive deltas for monotonic snapshots so cumulative counters are not
double-counted.
Quirks
- Antigravity is the only provider that requires a live process. A user who closes Antigravity loses the most-recent data until next launch (the cache covers older runs).
- Antigravity CLI has a shorter capture window than the desktop app.
agyexposes its language server only while the CLI session is active. The status line hook closes that gap for future sessions; older CLI.pbfiles still cannot be priced exactly unless an RPC snapshot was captured. - The 16 MB cap on RPC responses is necessary because individual cascades can balloon. Raising it risks OOM on the user's machine.
- Token types are split across
inputTokens,responseOutputTokens, andthinkingOutputTokens. Thinking is billed at output rate.
When fixing a bug here
- Reproducing the full provider path requires Antigravity running locally. The unit tests cover process flag parsing and wrapped/unwrapped RPC response extraction, but they do not stand up a live Antigravity RPC endpoint.
- Before any change, capture a sample protobuf response (anonymized) so future regressions can be tested against a recording.
- If the bug is "no data after Antigravity update", the protobuf schema may have shifted. The parser's response handling is the place to look.
- If the bug is "stale data", check whether the RPC is reachable; the cache fallback can mask connectivity issues.