Capture Antigravity CLI usage via statusLine#382
Merged
iamtoruk merged 2 commits intoMay 24, 2026
Conversation
Contributor
Author
Inregistrare.ecran.din.2026-05-23.la.04.03.24.mov |
Contributor
Author
|
The attached video shows the menubar path using the same |
- readStdin() now rejects input exceeding 1MB to prevent OOM from a buggy or runaway caller. - Switch from appendFile (mode only on creation) to open(path, 'a', 0o600) so the JSONL file is always created with private permissions. - Set cache directory mode to 0o700.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #381 by adding an opt-in Antigravity CLI statusLine hook for short
agysessions.Root cause
agyexposes useful usage data only while its short-lived local process is running. If CodeBurn's menubar refresh misses that window, CodeBurn can still discover CLI conversation files but cannot safely price them from local.pbhistory alone.What changed
codeburn antigravity-hook install|uninstall.agy-statusline-hook.context_window.current_usagetoken counters to CodeBurn's cache.agyis still alive.cacheReadInputTokensandcachedInputTokensdistinct socodeburn modelsdoes not double-count cache reads.statusLinewhen install uses--force.Validation
I validated this with a deterministic fixture using isolated temp state:
The fixture sends 4 real
agy-statusline-hookpayloads for one Antigravity CLI conversation:Hook sanitization proof:
The persisted JSONL keeps only sanitized aggregate usage:
{"conversationId":"agy-validation-conversation","sessionId":"agy-validation-session","model":"Gemini 3.5 Flash (High)","usage":{"inputTokens":1000,"outputTokens":100,"cacheCreationInputTokens":0,"cacheReadInputTokens":0}}Before: origin/main
Running the same isolated fixture against
origin/main:produced:
The JSON report was also empty:
{ "overview": { "cost": 0, "calls": 0, "sessions": 0, "tokens": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 } }, "models": [], "projects": [] }After: this branch
Running the same fixture against this branch:
produced:
The JSON model row confirms the raw model label, display mapping, call count, and cache accounting:
{ "provider": "antigravity", "model": "Gemini 3.5 Flash (High)", "modelDisplayName": "Gemini 3.5 Flash", "inputTokens": 1500, "outputTokens": 150, "cacheWriteTokens": 0, "cacheReadTokens": 200, "totalTokens": 1850, "calls": 2, "costUSD": 0.0036300000000000004 }This proves:
origin/mainmisses the Antigravity CLI statusLine usage completely.codeburn models.cwdfrom the raw hook payload is not persisted.Additional checks:
Privacy notes