Skip to content

Support Google Antigravity IDE/CLI client submission & improve Windows/WSL cross-platform token sync #648

@pancake37

Description

@pancake37

Description

Hi @junhoyeo! Love the project and the concept of framing token scale around developer advancement.

I am running Google Antigravity IDE & CLI in a hybrid environment concurrently on Windows and WSL (Ubuntu). I encountered a few architecture issues where my local Antigravity CLI token usage wasn't properly reflected on the web leaderboard at tokscale.ai, even after successfully running tokscale submit.

Here is a detailed breakdown of the limitations discovered and how I managed to solve them locally, along with feature requests to native-support this in the official codebase.


1. The Core Issues

A. Backend & Leaderboard Support

While tokscale's Rust core natively supports scanning the Antigravity manifest (~/.config/tokscale/antigravity-cache/manifest.json and session files in ~/.config/tokscale/antigravity-cache/sessions/), the server backend and leaderboard currently seem to drop or not display antigravity client tokens and custom model placeholders (e.g., model_placeholder_m84, model_placeholder_m16).

B. WSL/Windows Tilde (~) Paths in Rust WalkDir

In crates/tokscale-core/src/clients.rs, the gemini and antigravity clients define scan paths relative to PathRoot::Home.
Because tilde expansion (~) is a shell feature and not expanded by standard Rust library file APIs (like std::path::Path or WalkDir):

  • Headless background server runs inside WSL, but directories mapped via Windows /mnt/c/Users/... or broken symlinks across the WSL-Windows mount boundary prevent native RPC syncing (detected connections: 0 / headless scanning failures).

2. Workaround: Converting Antigravity logs to Gemini CLI format

To bypass the server backend limitation, I wrote an offline converter script that aggregates all raw Antigravity .jsonl files from both Windows mounts (/mnt/c/Users/<user>/.gemini/antigravity/.token-monitor/rpc-cache/v1/) and WSL native directories (~/.gemini/antigravity/.token-monitor/rpc-cache/v1/).

The script generates strict Gemini CLI (Legacy JSON) files inside ~/.gemini/tmp/ named session-<sessionId>.json with the following structure matching crates/tokscale-core/src/sessions/gemini.rs tests:

{
  "sessionId": "e8e2270e-8106-4c70-b732-d169d969204c",
  "projectHash": "",
  "startTime": "2026-04-29T12:43:44.239590+00:00",
  "lastUpdated": "2026-04-29T12:43:44.239590+00:00",
  "messages": [
    {
      "id": "msg_0",
      "timestamp": "2026-04-29T12:43:44.239590+00:00",
      "type": "gemini",
      "model": "gemini-3.1-pro",
      "tokens": {
        "input": 29462,
        "output": 172,
        "cached": 0,
        "thoughts": 70,
        "total": 29704
      }
    }
  ]
}

Since tokscale natively scans and parses ~/.gemini/tmp/*.json under ClientId::Gemini (Gemini CLI), this maps all the local Antigravity usage to gemini-3.1-pro model tokens, which is fully accepted by both the CLI aggregator and the web leaderboard!

After doing this conversion and clearing the cache, running tokscale submit successfully synced 1.2 Billion tokens to the global leaderboard under my profile (pancake37)!


3. Recommendations / Feature Requests

To fully integrate this out of the box, it would be awesome if we could:

  1. Enable Native Backend Support for Antigravity: Accept and register antigravity as a first-class client on tokscale.ai and map custom model placeholders correctly to their Google/Anthropic/pricing structures.
  2. Implement WSL-Windows Native Sync: Support scanning Windows user profiles (/mnt/c/Users/<user>/...) or allow custom scan directories via TOKSCALE_EXTRA_DIRS for the Antigravity integration.
  3. Add Manual Import Command: Implement a command like tokscale import --client <client_name> <path> or support direct local offline logs directory ingestion to avoid issues with background server sync processes.

Thanks for the amazing tool! Let me know if you need any PRs or raw log samples to help implement this.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions