[Bug / Data Loss] CLI (agy) conversations invisible in GUI sidebar/history and wiped from conversation_summaries.db on LS shutdown

Summary

When using both Antigravity CLI (agy) and the Antigravity GUI / IDE on the same machine, conversations initiated from the CLI are completely invisible in the GUI sidebar and /history view. Furthermore, shutting down the GUI’s Language Server overwrites conversation_summaries.db, wiping out unmapped CLI summary records.

Environment

  • OS: Windows 11 Pro (x64)
  • Antigravity Version: 2.25.0+ (Language Server v2.25)
  • Antigravity CLI: agy

Steps to Reproduce

  1. Start a conversation using the Antigravity CLI:
    agy "Hello, test session"
  2. Verify that the conversation runs and persists in local storage (~/.gemini/antigravity-cli/conversations/ and summaries).
  3. Open the Antigravity GUI / IDE.
  4. Check the left sidebar (Projects / Conversations) and navigate to /history.

Expected Behavior

Sessions created via the CLI should appear in the GUI’s conversation history / sidebar under the appropriate project (or “Outside of Project”), allowing the user to seamlessly resume in the GUI without risking database overwrites on shutdown.

Actual Behavior

None of the CLI conversations are visible in the sidebar or in /history. Only conversations originally initiated from within the GUI are displayed, and shutting down the Language Server clobbers non-local records in conversation_summaries.db.


Technical Root Cause & Code Analysis

  1. Frontend Filtering in main.js (CortexTrajectorySource.CLI):

    • The CLI assigns CortexTrajectorySource.CLI (source = 17) to trajectory_meta.source and in CascadeTrajectorySummary.
    • In main.js, the routing function only allows sources 0, 18, and 20:
      function Wma(source) {
        return source === CortexTrajectorySource.UNSPECIFIED || // 0
               source === CortexTrajectorySource.JETBOX ||      // 18
               source === CortexTrajectorySource.CIDER;         // 20
      }
      
    • When trajectorySummaries/startStream receives updates:
      updates.filter(([, t]) => Wma(t.source) && !t.trajectoryMetadata?.sourceMetadata?.hideFromConversationList)
      
      Wma(17) evaluates to false. As a consequence, CLI trajectories are routed into state.trajectorySummaries.externalSummaries instead of state.trajectorySummaries.summaries.
    • The UI components for the sidebar (dl = a => a.trajectorySummaries?.summaries) and /history exclusively read summaries (“local”), leaving externalSummaries as a complete UI dead-end with no user-facing toggle or panel to view them.
  2. Destructive Shutdown Flush in Language Server (reconcile_summaries.go):

    • Because language_server.exe only keeps the “local” subset in its active in-memory summaries cache, upon graceful shutdown it flushes its in-memory map back to conversation_summaries.db.
    • This flush overwrites the on-disk SQLite database, wiping out or omitting records that were not in its active in-memory set.
  3. Empty Title Omission on Reconciler Startup:

    • In reconcile_summaries.go, trajectories where title == "" are dropped from the startup stream even when a valid preview string or transcript.jsonl prompt exists.

Suggested Fix

  1. In main.js, add CortexTrajectorySource.CLI (17) to Wma(source), or add a filter toggle in the GUI sidebar (“Show CLI / External Conversations”) so users can browse CLI sessions.
  2. In language_server.exe, ensure the shutdown flush merges with existing disk state instead of clobbering unmapped records.
  3. Fall back to preview or the first prompt in reconcile_summaries.go if title is empty.