Repository navigation
Fix Antigravity usage and cost collection - #261
Merged
Merged
Conversation
NOX73
reviewed
Sep 15, 2026
NOX73
reviewed
Sep 15, 2026
Makes collect_usage idempotent across a cleanup retry (Accumulator.record always increments, and the result event is already the run's cumulative total, so a retry after any later cleanup failure would double every value). Reverts the collect_terminal_output artifact-plumbing change in the shared AgentSessionStrategy/WorkflowStepStrategy — collect_usage already falls back to reading the persisted terminal_output.log SessionLog, so no shared-strategy change is needed to reach it, removing blast radius on every other adapter. Also fixes session_command's non-interactive flag order: confirmed against the real agy 1.1.27 binary that --print immediately followed by another flag swallows it as literal prompt text instead of parsing it, silently breaking every non-interactive Antigravity session.
…etry The prior version reused the same in-memory TerminalSession across both collect_usage calls, so the usage_statistic association never reflected the first call's committed row and the guard never got exercised.
Add the observed low-tier model ids to fallback and pricing tables, surface unknown pricing in logs, and refresh the usage documentation.
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.
What changed
stream-jsonresult eventsWhy
antigravity_cliinherited the base no-opcollect_usage, leaving completed session usage and analytics empty. The live catalogue can also add model IDs without exposing prices, so the adapter now makes unknown pricing visible in logs.Pricing note
Antigravity exposes token counts but no pricing fields. Cost is an API-equivalent estimate based on configured public model-family rates; effort variants in the same family share those rates.
How to test
docker compose run --rm --entrypoint bin/rails -e RAILS_ENV=test web test test/services/agents/antigravity_cli_adapter_test.rb test/services/container_strategies/agent_session_strategy_test.rbdocker compose run --rm --entrypoint bundle web exec rubocop app/services/agents/antigravity_cli_adapter.rb test/services/agents/antigravity_cli_adapter_test.rb