Skip to content

fix(usage): recover Antigravity model names from session settings - #654

Merged
lzt404 merged 1 commit into
router-for-me:devfrom
wenbaolu6666-design:WenPaul/fix-antigravity-usage-model-03107
Nov 16, 2026
Merged

lzt404 merged 1 commit into
router-for-me:devfrom
wenbaolu6666-design:WenPaul/fix-antigravity-usage-model-03107

Conversation

@wenbaolu6666-design

@wenbaolu6666-design wenbaolu6666-design commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Antigravity's transcript.jsonl does not contain a model field. The selected model only appears inside USER_SETTINGS_CHANGE text:

The user changed setting `Model Selection` from None to Gemini 3.8 Flash (High).

As a result, every Antigravity session in Agent Usage was reported as an unknown model. Chunk files (chunks/*.jsonl) do not even contain this settings line.

Changes

src-tauri/src/agent_usage.rs (+154 / -0)

  • Parse the Model Selection settings text and map client labels to real model IDs:
    • Gemini 3.8 Flash (High) -> gemini-3.8-flash-high
    • Gemini 3.8 Flash (Low) -> gemini-3.8-flash-low
    • Gemini 3.8 Flash Lite -> gemini-3.5-flash-lite
    • Flash (Dynamic) / Flash Tiered -> gemini-3.8-flash-tiered
    • Gemini 3 Pro -> gemini-3-pro
  • When a chunk file has no settings line, fall back to the session's transcript.jsonl / transcript_full.jsonl (handles nested chunk directories).
  • Backfill samples with an empty model from the session model within the same file.
  • Add unit tests covering label mapping and settings-text extraction.

Verification

  • Cloud Windows amd64 build passed.
  • Recomputed in an isolated database copy with the built artifact: all Antigravity records were recognized as gemini-3.8-flash-high, with 0 empty-model rows.
  • Existing history can be corrected by updating the model column in place; no records need to be deleted (168 daily rows / 264 hourly rows, 877,199,033 tokens preserved in a local test).

Antigravity trajectories do not record a model field. The selected model
only appears in USER_SETTINGS_CHANGE text such as
"changed setting `Model Selection` ... to Gemini 3.8 Flash (High).",
so every Antigravity session showed up as an unknown model in agent usage.

- Parse the Model Selection settings text and map client labels to real
  model ids (Flash (High) -> gemini-3.8-flash-high, Flash (Low),
  Flash Lite, Dynamic/Tiered, Pro).
- Fall back to the sibling transcript.jsonl / transcript_full.jsonl when
  a chunk file contains no settings line, including nested chunk dirs.
- Backfill empty-model samples in the same session file.
- Add unit tests for label mapping and settings extraction.
@lzt404
lzt404 merged commit 016edd0 into router-for-me:dev Nov 16, 2026
5 checks passed
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