Skip to content

feat: Add Antigravity CLI and IDE local conversation provider (#8) - #9

Open
tolmachevmaxim wants to merge 7 commits into
BayramAnnakov:mainfrom
tolmachevmaxim:feat/antigravity-support
Open

feat: Add Antigravity CLI and IDE local conversation provider (#8)#9
tolmachevmaxim wants to merge 7 commits into
BayramAnnakov:mainfrom
tolmachevmaxim:feat/antigravity-support

Conversation

@tolmachevmaxim

@tolmachevmaxim tolmachevmaxim commented Aug 18, 2026

Copy link
Copy Markdown

Summary

Closes #8

This PR adds full support for Antigravity CLI and IDE (antigravity) as a first-class local conversation source in Retain, along with key stability bug fixes, cross-provider global search, and session persistence improvements:

1. Antigravity CLI & IDE Support

  • Two-Pass Merging: Discovers and merges transcript.jsonl (complete step history) and transcript_full.jsonl (untruncated rolling window of message content and tool outputs) by step_index to guarantee 100% complete conversations without missing initial prompts.
  • Tolerant Parsing: Handles multiline JSON output, sanitizes unescaped control characters inside string literals, and parses Antigravity's ISO8601 UTC timestamps (including non-fractional second formats like YYYY-MM-DDTHH:MM:SSZ).
  • Deterministic Identity & Deduplication: Generates deterministic message UUIDs and external IDs based on \(conversationId):\(stepIndex), preventing RUNNING -> DONE step duplicate orphans in SQLite.
  • Noise Filtering & Content Cleaning: Strips Antigravity UI XML wrappers (<USER_REQUEST>, <ADDITIONAL_METADATA>, <USER_SETTINGS_CHANGE>, <SYSTEM_MESSAGE>) and filters internal agent system types (CONVERSATION_HISTORY, GENERIC, EPHEMERAL_MESSAGE, DIRECTORY_RULES).
  • Metadata & Workspace Enrichment: Reads cache/conversation_metadata.json and cache/last_conversations.json to resolve conversation preview titles and decode file:// workspace paths.
  • Live Sync & File Watching: Integrated with SyncService (full and incremental sync) and FileWatcher (monitoring candidate brain/ directories for .jsonl changes).
  • Settings & UI Support: Integrated into ProviderRegistry, AppState, ContentView sidebar & empty states, SettingsView toggle & path diagnostics, and OnboardingView tool detector.
  • Unit Tests: Full test suite in AntigravityParserTests.swift covering merge logic, multiline parsing, date handling, identity deduplication, content cleaning, and workspace decoding.

2. Analytics Stability & Performance Fixes

  • Eliminated 100% Crash on Navigation: Fixed fatal crash in AnalyticsDataBuilder.fetchHourlyActivity caused by row["timestamp"] throwing GRDB decoding errors on non-standard timestamp strings.
  • Fast SQL Aggregation: Converted hourly activity into direct SQLite strftime('%H', m.timestamp) aggregation, reducing query time to < 1 ms without loading hundreds of thousands of rows into memory.
  • Defensive Date Decoding & Merging: Replaced crashing Dictionary(uniqueKeysWithValues:) with safe uniquingKeysWith: merging in buildContributionDays and fetchConsistencyTrend.
  • Chart Domain Safety: Made providerDomain in TaskAffinityView and CorrectionRateView include all present providers dynamically, preventing Swift Charts domain mismatch precondition aborts.

3. Cross-Provider All-Time Search ("All Conversations")

  • Added SmartFolder.all = "All Conversations" at the top of the Smart Folders sidebar section.
  • Selecting it displays all conversations across all providers for all time and enables global cross-provider search.

4. Web Accounts Session Persistence Fix

  • Fixed an issue where Claude.ai and ChatGPT web sessions disconnected upon app restart.
  • KeychainHelper now attempts Data Protection keychain first and gracefully falls back to standard generic password keychain when running without access group entitlements (errSecMissingEntitlement -34018), ensuring session cookies and API keys are reliably saved and restored.

5. Settings & AI Features Polish

  • Polished settings labels and section headers to clearly distinguish local CLI tools (Claude Code, Antigravity) from cloud-based Google AI Studio extraction.

Supported Locations

Scans standard Antigravity storage roots:

  • ~/.gemini/antigravity-cli/
  • ~/.gemini/antigravity/
  • ~/.gemini/antigravity-ide/
  • ~/.antigravity/

Testing

  • Verified against on-disk corpus of 72 live Antigravity conversations (2,905 messages).
  • Verified Analytics calculations and rendering on real database with 232,000+ messages.
  • Verified Keychain roundtrip persistence across restarts.
  • All unit tests and parser suites pass.

…Annakov#8)

- Add Antigravity provider to Provider enum and ProviderRegistry
- Implement AntigravityParser with two-pass merging (transcript.jsonl + transcript_full.jsonl)
- Add tolerant multiline JSON reader and prompt cleaning
- Add step-keyed message identity to prevent RUNNING->DONE duplicate orphans
- Support metadata enrichment (Preview titles, decoded workspace URIs)
- Integrate full and incremental sync in SyncService and FileWatcher
- Update AppState, ContentView, SettingsView, and OnboardingView UI
- Add comprehensive AntigravityParserTests suite
…n, web session persistence and add all-conversations search
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.

[Feature] Add Antigravity CLI as a local conversation source

1 participant