Skip to content

global-discover misses Antigravity CLI (agy) sessions — scans legacy ~/.gemini/tmp JSON, not ~/.gemini/antigravity-cli/conversations/*.db #1977

Closed

Description

@Akagilnc

scanGemini() in bin/gstack-global-discover.ts (around line 372) scans ~/.gemini/tmp/<project>/chats/session-*.json — the legacy Gemini CLI JSON format. The Antigravity CLI (agy), which shares the ~/.gemini/ home directory, stores its sessions as SQLite under ~/.gemini/antigravity-cli/conversations/*.db. These are never scanned, so all agy usage is invisible to discovery.

Evidence (my machine, 2026-06-11)

  • ~/.gemini/antigravity-cli/conversations/: 504 .db files, newest mtime today (2026-06-11 23:44).
  • ~/.gemini/tmp/**/session-*.json modified in the last 14 days: 0.
  • Net effect: the gemini tool count in discover output is effectively always ~0 for any agy-primary user, silently undercounting cross-tool activity.

Why it isn't a one-line path swap

The agy .db schema is blob-encoded — tables are trajectory_meta, steps, gen_metadata, executor_metadata, parent_references, trajectory_metadata_blob, battle_mode_infos — with no plain cwd/path/repo column. discover's repo-mapping relies on cwd, which here lives inside a protobuf/JSON blob payload. Supporting agy therefore means a new SQLite scanner that opens each .db and decodes a blob to recover cwd (perf note: hundreds of dbs per machine).

Suggested fix

Add a scanAntigravity() alongside scanGemini(), gated on existsSync(~/.gemini/antigravity-cli/conversations), surfaced either under the existing gemini bucket or a new agy tool tag.


Reported from gstack 1.57.10.0.

Activity

  1. xg-gh-25 commented on Jun 12, 2026

    @xg-gh-25

    This is a clean example of the session discovery gap that emerges when tools share a home directory but diverge on storage backends — in this case, Gemini CLI's JSON vs Antigravity's SQLite blobs.

    We hit a similar boundary when adding cross-platform discovery to our harness: Claude Desktop stores sessions in SQLite (~/.config/Claude/sessions.db), while our internal tool uses versioned JSONL. The naive glob-by-extension misses entire swaths of work history. Your evidence (504 .db files vs 0 recent JSON) mirrors what we saw before building a SQLite scanner — the legacy path is a ghost town once users migrate tools.

    Re: "Why it isn't a one-line path swap" — agreed. The blob-encoded schema (trajectory_metadata_blob, likely protobuf/MessagePack) means you can't just SELECT cwd like you could with JSON. We handle this in two stages:

    1. Detect schema version via PRAGMA table_info → if blobs present, route to blob decoder
    2. Decode cwd lazily (on-demand per .db, not upfront bulk scan) to bound perf hit

    For scanAntigravity(), suggest:

    • Open each .db, read trajectory_meta table's blob column
    • Parse protobuf (or fall back to heuristic regex if proto schema isn't public) to extract cwd
    • Cache mapping in a sidecar .discovery-cache.json per .db file (only re-scan if mtime changed)

    This keeps discover fast after the initial pass (hundreds of dbs → parse once, mtime-check thereafter). Tagging under a new agy tool bucket makes sense to distinguish usage patterns (agy sessions tend to be longer-running, different from CLI ephemeral chats).


    Cross-tool session discovery lesson from SwarmAI. Discussion: T-MEM

  2. capy-ai commented on Oct 11, 2026

    @capy-ai
    Contributor

    Thanks @Akagilnc for the idea. In the Oct 11 triage we grouped the open feature requests by theme so related asks get built together instead of one at a time. This one is part of the New hosts theme in TODOS.md (https://github.com/garrytan/gstack/blob/50d020ad9/TODOS.md#L54-L69), tracked as a whole in #3137. Closing it here so the open list stays actionable; it isn't rejected, and the theme credits every linked reporter when it's picked up.

  3. added
    parked
    on Oct 25, 2026
  4. capy-ai commented on Oct 25, 2026

    @capy-ai
    Contributor

    Reopened under the parked label: this is tracked in the New hosts theme in TODOS.md and tracking issue #3137 (https://github.com/garrytan/gstack/blob/main/TODOS.md#p3-feature-themes-from-the-wave-9-triage-filed-2026-10-11), and what fixes it is the host-config work that adds installable hosts; each new host lands as its own ./setup --host <name> arm. Closed-but-tracked read as closed, so parked issues now stay open until they ship, are duplicates, or are declined (https://github.com/garrytan/gstack/blob/main/docs/triage.md).

  5. added
    S3
    enhancement
    on Oct 31, 2026
  6. capy-ai commented on Oct 31, 2026

    @capy-ai
    Contributor

    Thanks @Akagilnc for the report and the store layout. #3740 makes /retro global count Antigravity CLI sessions (~/.gemini/antigravity-cli/conversations/*.db, by the later of each database's and its -wal file's mtime) in the session total, so an Antigravity-only week no longer reads as zero. It does not attribute those sessions to a repo yet: the working directory sits inside an undocumented blob, so they show as unattributed. This issue stays open for that blob decoding.

  7. capy-ai commented on Oct 31, 2026

    @capy-ai
    Contributor

    Thanks again for the report and the store layout, @Akagilnc. Following up on the note above: we decided not to land #3740 after all. Few people would see a difference, and Antigravity keeps the project folder inside an encoded database, so we couldn't reliably tell which repo a session belongs to. Closing as not planned.

  8. reopened this on Nov 1, 2026
  9. capy-ai commented on Nov 1, 2026

    @capy-ai
    Contributor

    Fixed in #3740, released in v1.92.20.0: /retro global now counts Antigravity CLI sessions in the total, without a repo, because the CLI stores the working directory in an undocumented blob. This was closed as not planned earlier; that decision was reversed and the fix landed. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S3enhancementparked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions