Skip to content

feat: Add support for the Antigravity client#345

Open
bruce-shi wants to merge 5 commits intojunhoyeo:mainfrom
bruce-shi:main
Open

feat: Add support for the Antigravity client#345
bruce-shi wants to merge 5 commits intojunhoyeo:mainfrom
bruce-shi:main

Conversation

@bruce-shi
Copy link
Copy Markdown

@bruce-shi bruce-shi commented Mar 19, 2026

feat: Add support for the Antigravity client, including session parsing from .pb files and token usage extraction via language server RPC:
POST /exa.language_server_pb.LanguageServerService/GetCascadeTrajectory


Summary by cubic

Add Antigravity (Windsurf/Codeium) client support to parse local .pb conversations and fetch token usage via the language server RPC. Synced with upstream and fixed client index/count to avoid ID conflicts.

  • New Features

    • Added Antigravity client scanning ~/.gemini/antigravity/conversations for *.pb.
    • Discovers the language server and POSTs to /exa.language_server_pb.LanguageServerService/GetCascadeTrajectory to extract input/output/cache-read/reasoning tokens.
    • Deduplicates by responseId, resolves model aliases/placeholders, and infers provider for pricing.
    • Integrated into parse_all_messages_with_pricing and parse_local_clients; TUI shows "Antigravity" with hotkey a.
    • Added Windsurf model aliases in pricing to normalize variants.
  • Migration

    • Ensure the Windsurf/Antigravity language server is running during parsing; otherwise no usage is returned.
    • No config changes required.

Written for commit 71880af. Summary will update on new commits.

…ng from `.pb` files and token usage extraction via language server RPC.
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 19, 2026

@bruce-shi is attempting to deploy a commit to the Inevitable Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-ai with guidance or docs links (including llms.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")
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
provider_identity::inferred_provider_from_model(model).unwrap_or("google")
provider_identity::inferred_provider_from_model(model).unwrap_or("unknown")
Fix with Cubic

None => continue,
};

let body = format!(r#"{{"cascadeId":"{}"}}"#, cascade_id);
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
let body = format!(r#"{{"cascadeId":"{}"}}"#, cascade_id);
let body = serde_json::json!({ "cascadeId": cascade_id }).to_string();
Fix with Cubic

value
.and_then(|v| {
v.as_i64()
.or_else(|| v.as_u64().map(|n| n as i64))
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Unchecked u64i64 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>
Fix with Cubic

junhoyeo and others added 4 commits March 25, 2026 14:54
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.
@junhoyeo junhoyeo force-pushed the main branch 2 times, most recently from 63e6d84 to bef1da8 Compare March 25, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants