feat: Add support for the Antigravity client#345
feat: Add support for the Antigravity client#345bruce-shi wants to merge 5 commits intojunhoyeo:mainfrom
Conversation
…ng from `.pb` files and token usage extraction via language server RPC.
|
@bruce-shi is attempting to deploy a commit to the Inevitable Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
3 issues found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/tokscale-core/src/sessions/antigravity.rs">
<violation number="1" location="crates/tokscale-core/src/sessions/antigravity.rs:310">
P2: Unchecked `u64`→`i64` cast can wrap large token counts negative and then clamp them to 0, causing silent token undercounting.</violation>
<violation number="2" location="crates/tokscale-core/src/sessions/antigravity.rs:325">
P2: Unknown/unmapped Antigravity models are incorrectly attributed to Google because provider fallback is hardcoded to `google` when inference fails.</violation>
<violation number="3" location="crates/tokscale-core/src/sessions/antigravity.rs:495">
P2: RPC JSON body is built via string interpolation, so `cascade_id` is not escaped and can break request serialization for valid filename stems.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| /// Get provider from model name (e.g. "gemini-2.5-pro" → "google"). | ||
| fn get_provider(model: &str) -> &'static str { | ||
| provider_identity::inferred_provider_from_model(model).unwrap_or("google") |
There was a problem hiding this comment.
P2: Unknown/unmapped Antigravity models are incorrectly attributed to Google because provider fallback is hardcoded to google when inference fails.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/tokscale-core/src/sessions/antigravity.rs, line 325:
<comment>Unknown/unmapped Antigravity models are incorrectly attributed to Google because provider fallback is hardcoded to `google` when inference fails.</comment>
<file context>
@@ -0,0 +1,745 @@
+
+/// Get provider from model name (e.g. "gemini-2.5-pro" → "google").
+fn get_provider(model: &str) -> &'static str {
+ provider_identity::inferred_provider_from_model(model).unwrap_or("google")
+}
+
</file context>
| provider_identity::inferred_provider_from_model(model).unwrap_or("google") | |
| provider_identity::inferred_provider_from_model(model).unwrap_or("unknown") |
| None => continue, | ||
| }; | ||
|
|
||
| let body = format!(r#"{{"cascadeId":"{}"}}"#, cascade_id); |
There was a problem hiding this comment.
P2: RPC JSON body is built via string interpolation, so cascade_id is not escaped and can break request serialization for valid filename stems.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/tokscale-core/src/sessions/antigravity.rs, line 495:
<comment>RPC JSON body is built via string interpolation, so `cascade_id` is not escaped and can break request serialization for valid filename stems.</comment>
<file context>
@@ -0,0 +1,745 @@
+ None => continue,
+ };
+
+ let body = format!(r#"{{"cascadeId":"{}"}}"#, cascade_id);
+ let resp = match rpc_call(&server, "GetCascadeTrajectory", &body) {
+ Some(r) => r,
</file context>
| let body = format!(r#"{{"cascadeId":"{}"}}"#, cascade_id); | |
| let body = serde_json::json!({ "cascadeId": cascade_id }).to_string(); |
| value | ||
| .and_then(|v| { | ||
| v.as_i64() | ||
| .or_else(|| v.as_u64().map(|n| n as i64)) |
There was a problem hiding this comment.
P2: Unchecked u64→i64 cast can wrap large token counts negative and then clamp them to 0, causing silent token undercounting.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/tokscale-core/src/sessions/antigravity.rs, line 310:
<comment>Unchecked `u64`→`i64` cast can wrap large token counts negative and then clamp them to 0, causing silent token undercounting.</comment>
<file context>
@@ -0,0 +1,745 @@
+ value
+ .and_then(|v| {
+ v.as_i64()
+ .or_else(|| v.as_u64().map(|n| n as i64))
+ .or_else(|| v.as_str().and_then(|s| s.parse::<i64>().ok()))
+ })
</file context>
bun publish v1.1.38 fails with 404 on scoped package metadata lookups when relying solely on NPM_CONFIG_TOKEN env var. Create an explicit .npmrc with the auth token before each publish step.
bun publish v1.1.38 treats the expected 404 for new versions as a fatal error instead of proceeding with the publish. npm publish is the canonical tool and doesn't have this regression. Also removed unnecessary bun setup from platform package jobs.
npm ignores workspace-level .npmrc files — write to ~/.npmrc instead. Also normalize repository.url to git+https:// format in all platform and CLI package.json files to suppress npm publish warnings.
…igravity client index conflicts)
63e6d84 to
bef1da8
Compare
feat: Add support for the Antigravity client, including session parsing from
.pbfiles and token usage extraction via language server RPC:POST
/exa.language_server_pb.LanguageServerService/GetCascadeTrajectorySummary by cubic
Add Antigravity (Windsurf/Codeium) client support to parse local
.pbconversations and fetch token usage via the language server RPC. Synced with upstream and fixed client index/count to avoid ID conflicts.New Features
Antigravityclient scanning~/.gemini/antigravity/conversationsfor*.pb./exa.language_server_pb.LanguageServerService/GetCascadeTrajectoryto extract input/output/cache-read/reasoning tokens.responseId, resolves model aliases/placeholders, and infers provider for pricing.parse_all_messages_with_pricingandparse_local_clients; TUI shows "Antigravity" with hotkeya.Migration
Written for commit 71880af. Summary will update on new commits.