Repository navigation
feat(adapter): add antigravity agent source - #1487
sambitcreate wants to merge 3 commits into
Conversation
Track Google Antigravity IDE/CLI usage from local SQLite conversation
databases under ~/.gemini/antigravity{,-cli,-ide,-backup}. Each
gen_metadata row is decoded as a GeneratorMetadata protobuf with a
hand-rolled wire reader, yielding per-generation input (fixed system
prompt plus fresh), output, cache-read, and thinking tokens, a
timestamp fallback chain, and responseId dedup across databases.
Opaque model ids (MODEL_PLACEHOLDER_*, gemini-3-flash-a/b/c, tier
suffixes) resolve through an alias table to LiteLLM-priced names.
Adds the ccusage antigravity daily|monthly|session commands, unified
all-agents report integration, ANTIGRAVITY_DATA_DIR override, config
schema section, and fixture-backed parser/loader tests.
Add the antigravity guide page, VitePress sidebar entry, and update the README and docs agent lists, environment variables, configuration, and getting-started pages for the new source.
Extend the models.dev snapshot KEEP filter to Gemini so offline pricing covers models LiteLLM has not published yet, notably the gemini-3.6-flash and gemini-3.1-pro families reported by Antigravity. Regenerate the committed snapshot (317 to 448 entries) and the codex auto-review fallbacks from the same catalog. The claude-opus-5 unknown-version test assertion moves to claude-opus-6 because the upstream catalog now prices claude-opus-5.
|
This PR was auto-closed. Only contributors approved with Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply. If a maintainer replies See CONTRIBUTING.md. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (32)
📝 WalkthroughWalkthroughAntigravity support is added across the Rust CLI, configuration schema, SQLite/protobuf data adapter, report generation, pricing snapshots, progress reporting, tests, and user documentation. ChangesAntigravity support
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — adds Google Antigravity as a tracked agent source with CLI commands, all-agent integration, custom protobuf decoding, and regenerated pricing snapshot with Gemini model coverage.
- Add
adapter/antigravitymodule — loader, parser, proto wire-format reader, paths, report, and mod.rs entry point. Decodes usage from local SQLite conversation databases under~/.gemini/antigravity*(four roots: antigravity, antigravity-cli, antigravity-ide, antigravity-backup).ANTIGRAVITY_DATA_DIRoverrides with comma-separated roots. - Custom protobuf decoder (
proto.rs) — varint, fixed64, length-delimited, and fixed32 wire types; groups terminate parsing; truncated input stops iteration cleanly. DecodesGeneratorMetadata(model id, timestamp, token counts, responseId) andtrajectory_metadata_blob(session created-at, workspace URI). - Model alias mapping (
resolve_model_name, case-insensitive) — maps Antigravity opaque ids (MODEL_PLACEHOLDER_M16→gemini-3.1-pro), tier-suffixed Gemini names, and thinking variants to LiteLLM-priced canonical names. Unknown ids pass through unchanged. - Timestamp fallback chain — generation timestamp → session created-at → file mtime. Nanos validation rejects out-of-range values.
responseIddedup across all databases, first-occurrence-wins by root path order. All-zero token generations are skipped. - CLI plumbing —
Antigravitycommand variant,parse_basic_agent_command, standard report dispatch, help entries, root help snapshot, CLI command test. - All-agent integration —
BUILT_IN_AGENT_NAMESentry,AgentLoadSpecat index 15 inload_base_rows,agent_labelin all-agent report,UsageLoadAgent::Antigravityin progress tracking. - Config schema —
AntigravityConfigwith defaults and commands, regeneratedconfig-schema.jsonwith antigravity properties, schema edge test asserting noopenClawPathleak. - Pricing snapshot regeneration — KEEP filter extended with
geminiinmodels-dev-gen.ts(317→448 entries). Upstream catalog churn: newclaude-opus-5entries,gemini-*model entries,databricks-gemini-*,cline-pass/kimi-*; removedclaude-opus-4-7-fastandglobal.anthropic.*entries. Test assertion for unknown-version model moves fromclaude-opus-5toclaude-opus-6. - Documentation — new
docs/guide/antigravity/index.mdwith full source docs, env-var table, getting-started paths, config-files namespaces, all-reports table row, VitePress navigation, docs index tagline/features, README agent table andbunxexample. Source-support Q&A removes the "Antigravity not supported" entry.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…#1569) revert: "feat(antigravity): add Antigravity CLI usage adapter (#1544)" This reverts commit 50614f1. Temporary, so that v20.0.20 does not ship a half-finished adapter. The intent is to reapply Antigravity support, not to drop it — see #1488. #1544 landed while the contribution proposal in #1488 was still open, and it covers less ground than @sambitcreate's #1487: - It reads only `~/.gemini/antigravity-cli`, missing `antigravity`, `antigravity-ide` and `antigravity-backup`, so IDE users get nothing. - Opaque model ids stay as `antigravity-model-<id>` with no alias table, so they cannot be priced and cost is silently understated. - The offline pricing snapshot has no Gemini rates, so `--offline` reports no cost for Gemini models. - It was validated against three chat turns in one CLI conversation. - Retries, subagents and model comparison ship unexercised. The first three are already solved in #1487, which is the better base to build on. Reverting now keeps the release clean while that is sorted out, and costs nothing: the adapter has not been released, so no user has it. Nothing about the reverse engineering is lost. The recovered field numbers and the reasoning behind the dedupe are written up in #1488.
|
Historical audit: this pull request was auto-closed by the legacy contributor gate. That closure did not assess technical importance. Audit result: needs review. The current state does not prove resolution, but a fresh technical or product check is required before deciding whether the underlying request is still relevant. This closed PR will not be revived as-is; create a new PR only after reviewing the related issue and current |

Summary
Adds Google Antigravity (IDE + CLI) as a tracked agent source, exposed as
ccusage antigravity daily|monthly|sessionand included in the unified all-agents report.Usage is decoded fully offline from the local SQLite conversation databases under
~/.gemini/antigravity{,-cli,-ide,-backup}/conversations/*.db. Eachgen_metadatarow is aGeneratorMetadataprotobuf decoded with a small hand-rolled wire reader, yielding per-generation input (fixed system prompt plus fresh), output, cache-read, and thinking tokens, a timestamp fallback chain (generation → session created-at → file mtime), andresponseIddedup across databases. Opaque model ids (MODEL_PLACEHOLDER_*,gemini-3-flash-a/b/c, tier suffixes) resolve through an alias table to LiteLLM-priced names; unknown ids pass through.ANTIGRAVITY_DATA_DIRoverrides the data roots.Also embeds Gemini models in the committed models.dev pricing snapshot (KEEP filter extended; 317 → 448 entries) so offline cost calculation covers the
gemini-3.6-flashandgemini-3.1-profamilies that LiteLLM has not published yet. The codex auto-review fallbacks are regenerated from the same catalog, and theclaude-opus-5unknown-version test assertion moves toclaude-opus-6since the upstream catalog now prices it.Testing
cargo test --workspace: 469 passed, 0 failed (28 new antigravity tests: decode, timestamp fallbacks, cross-DB dedup, alias mapping, path discovery, plus a skipped-when-absent smoke test against real data dirs)cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --all -- --check: cleanbun test nix/models-dev-compact.test.ts: 7 passedNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Adds Antigravity as a new agent source with daily, monthly, and session reports, plus unified all-agents support. Usage is parsed offline from local SQLite conversation databases with model aliasing and cost calculation.
New Features
ccusage antigravity daily|monthly|session.~/.gemini/antigravity{,-cli,-ide,-backup}/conversations/*.db; override withANTIGRAVITY_DATA_DIR.gen_metadataprotobufs to count input, output, cache-read, and thinking tokens; timestamp fallbacks and cross-DBresponseIddedup.Dependencies
models.devpricing snapshot now includes Gemini models for offline costs (e.g., gemini-3.6-flash, gemini-3.1-pro).claude-opus-5.Written for commit c58c1b3. Summary will update on new commits.
Summary by CodeRabbit
New Features
Documentation