Repository navigation
feat(antigravity): add Antigravity Desktop session migration support #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
elijahr
wants to merge
10
commits into
xhluca:main
Choose a base branch
from
elijahr:feat/antigravity-desktop-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,938
−38
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ed24bbc
feat(antigravity): add Antigravity Desktop session migration support
elijahr 351f9fe
feat(antigravity-desktop): add cross-platform path resolution and pla…
elijahr 94412ba
fix(antigravity-desktop): correct language_server location to resourc…
elijahr 7041449
feat(antigravity-desktop): pin binary specifications for macOS, Linux…
elijahr 4f964b4
fix(antigravity-desktop): bump module docstring version and include A…
elijahr 98d388a
docs(antigravity-desktop): align format documentation name and invoca…
elijahr 6763b5a
docs(antigravity-desktop): structure format doc to mirror antigravity…
elijahr 0554dcd
docs: normalize Antigravity Desktop version to 2.18.1
elijahr edde43c
fix(antigravity-desktop): address review feedback and restore public …
elijahr 77531e0
merge: resolve conflicts with upstream/main (0.12.0)
elijahr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,181 @@ | ||
| # Antigravity Desktop session format | ||
|
|
||
| `session-migrate` supports Antigravity Desktop (macOS, Linux, and Windows) | ||
| through a clean-room adapter pinned to the 2.18.1 release: | ||
|
|
||
| | Property | Pinned value | | ||
| | --- | --- | | ||
| | Application | Antigravity Desktop `2.18.1` (Electron `44.3.0`) | | ||
| | macOS arm64 binary | `148,990,608` bytes, SHA-256 `300ee20f3108a511be1149602b91ba84cbbdcc42213067151e255584129be30f` | | ||
| | Linux x64 binary | `181,432,528` bytes, SHA-256 `ab4937445fa3817bc374a1db71062de7daecdb093cbfb6bd36b80f443198670e` | | ||
| | Windows x64 binary | `163,640,320` bytes, SHA-256 `1ed84e6a1d1e51064d80c9f382ab3a519eb2775cb91d552c63064a18cfdf3cf2` | | ||
| | Conversation store | `<home>/.gemini/antigravity/conversations/<uuid>.db` | | ||
| | Picker index | `<home>/.gemini/antigravity/conversation_summaries.db` (`PRAGMA user_version = 3`) | | ||
|
|
||
| This is deliberately not a claim of compatibility with unreleased or arbitrary | ||
| Antigravity versions. Automatic installation checks executable digests and | ||
| schema invariants when native verification is requested. | ||
|
|
||
| No vendor code, binaries, descriptors, credentials, or user transcripts are | ||
| included in this repository. All schemas, wire mappings, and RPC endpoints were | ||
| established through clean-room differential probing and synthetic test fixtures. | ||
|
|
||
| ## How the format was established | ||
|
|
||
| The adapter was derived from independent observations of synthetic sessions and | ||
| package analysis across macOS, Linux, and Windows distributions: | ||
|
|
||
| 1. generate synthetic conversations with unique marker text in isolated environments; | ||
| 2. inspect SQLite schema, columns, and Protobuf wire field numbers and types; | ||
| 3. analyze Electron application resources (`app.asar`), verifying identical JavaScript | ||
| (`3c03ce352dc3c1b43f357c27ead1f73c74d198a8ded89b1b3d6a2539e7a6ac5c`) across all three OSes; | ||
| 4. inspect native Go language server (`language_server`) symbols and Connect-RPC endpoints; | ||
| 5. verify round-trip serialization and cold-reload step retrieval via Connect-RPC | ||
| (`GetCascadeTrajectorySteps`); and | ||
| 6. test real-world conversation migration end-to-end with active multi-turn sessions. | ||
|
|
||
| ## SQLite layout | ||
|
|
||
| Each conversation is stored as an independent SQLite 3 database with write-ahead | ||
| logging (`WAL`) containing these tables: | ||
|
|
||
| ```text | ||
| trajectory_meta | ||
| steps | ||
| gen_metadata | ||
| executor_metadata | ||
| parent_references | ||
| trajectory_metadata_blob | ||
| battle_mode_infos | ||
| ``` | ||
|
|
||
| While the table names match Antigravity CLI, Desktop enforces distinct wire and | ||
| metadata invariants: | ||
|
|
||
| | Property | Antigravity CLI (`antigravity`) | Antigravity Desktop (`antigravity-desktop`) | | ||
| | --- | --- | --- | | ||
| | App data subdirectory | `~/.gemini/antigravity-cli` | `~/.gemini/antigravity` | | ||
| | `trajectory_meta.source` | `17` (`CLI`) | `1` (`IDE` / `Hub`) | | ||
| | `trajectory_metadata_blob` project ID | `"default-cli-project"` | `"outside-of-project"` (or workspace UUID) | | ||
| | `conversation_summaries.source` | `"antigravity-cli"` | `""` (empty string) | | ||
| | `conversation_summaries.app_data_dir` | `"antigravity-cli"` | `"antigravity"` | | ||
| | `conversation_summaries.status` | `""` (empty string) | `"CASCADE_RUN_STATUS_IDLE"` | | ||
| | `conversation_summaries.project_id` | `"default-cli-project"` | `"outside-of-project"` | | ||
| | Summary columns | 19 or 21 columns | 21 columns (includes `raw_summary`, `group_id`) | | ||
| | Subagent trajectory roots | root ID == conversation ID | root ID points to root cascade ID | | ||
|
|
||
| The main `trajectory_meta` row stores a fresh trajectory UUID, conversation UUID, | ||
| trajectory type `4` (cascade), and source `1` (`IDE`/`Hub`). `steps.idx` is a | ||
| contiguous zero-based sequence. Every step duplicates its type and status in | ||
| both the SQLite row columns and the serialized `Step` blob. | ||
|
|
||
| ### Sidebar discovery and project grouping | ||
|
|
||
| Antigravity Desktop organizes sidebar conversations by active project. In the | ||
| current implementation, `install_database` writes the authoritative SQLite | ||
| conversation database and summary entry with `project_id = "outside-of-project"`. | ||
| Project association and UI tree indexing are managed by the Desktop application | ||
| upon launch. | ||
|
|
||
| ## Protobuf subset and Hub cache | ||
|
|
||
| The adapter contains a bounded wire codec without generated vendor classes. It | ||
| accepts canonical varints, length-delimited bytes, and fixed 32/64-bit wire types. | ||
|
|
||
| The `Step` envelope uses: | ||
|
|
||
| | Field | Meaning | | ||
| | --- | --- | | ||
| | `1` | step type enum | | ||
| | `4` | step status enum | | ||
| | `19` | user-input payload when type is `14` (`CORTEX_STEP_TYPE_USER_INPUT`) | | ||
| | `20` | planner-response payload when type is `15` (`CORTEX_STEP_TYPE_PLANNER_RESPONSE`) | | ||
| | `140` | generic-tool payload when type is `132` (`CORTEX_STEP_TYPE_GENERIC_TOOL`) | | ||
|
|
||
| Status `3` is done, status `5` is cleared, and status `7` is error. User-input | ||
| field `2` stores visible user text. Planner-response field `1` stores visible | ||
| assistant text, field `6` stores a fresh message ID, and repeated field `7` | ||
| stores tool calls. | ||
|
|
||
| ### Hub summary cache | ||
|
|
||
| Antigravity Desktop maintains an internal cache in `agyhub_summaries_proto.pb`. | ||
| When started, the native Go process (`language_server`) reconciles SQLite | ||
| conversation and summary records. `session-migrate` writes the authoritative | ||
| SQLite conversation and `conversation_summaries.db` records; protobuf cache | ||
| reconciliation occurs when the Desktop application starts. | ||
|
|
||
| ## Conversion policy | ||
|
|
||
| | Portable event | Antigravity Desktop representation | | ||
| | --- | --- | | ||
| | User text | done user-input step | | ||
| | Assistant text | done planner-response step | | ||
| | Tool call | planner-response tool call | | ||
| | Tool result | following generic-tool step | | ||
| | Thinking/reasoning | omitted and counted as `thinking:private` | | ||
| | Compaction | omitted and counted | | ||
| | System/developer message | omitted as privileged context | | ||
| | Images and other context | omitted by type and counted | | ||
| | Unknown/opaque source event | omitted by reason and counted | | ||
|
|
||
| Private chain-of-thought is not portable. Thinking bytes and model signatures are | ||
| omitted from generated outputs, and source reading emits only a content-free | ||
| `thinking` marker. | ||
|
|
||
| A tool result without a preceding call receives a fresh synthetic call and an | ||
| explicit orphan counter. Duplicate or out-of-order IDs are rewritten or counted | ||
| to prevent corrupted native trajectories. | ||
|
|
||
| ## Reading and installation | ||
|
|
||
| Source databases may have active write-ahead logs (`.db-wal`). The reader uses | ||
| SQLite's backup API to obtain a transactionally consistent snapshot, then hashes | ||
| and parses that snapshot. It validates: | ||
|
|
||
| - exact table, column, and schema invariants; | ||
| - SQLite page bounds and `integrity_check`; | ||
| - valid canonical UUIDv4 IDs and source `1` / `17` discrimination; | ||
| - contiguous step indices and supported step types; and | ||
| - structurally valid, bounded protobuf values. | ||
|
|
||
| Native installation creates target directories privately, reserves the summary | ||
| ID with `BEGIN IMMEDIATE`, writes the database atomically, and commits the | ||
| summary transaction. If a transaction fails, only newly created files are | ||
| unlinked. Existing sessions are never overwritten. | ||
|
|
||
| ## Native validation evidence | ||
|
|
||
| 1. **Synthetic Round-Trip Invariants**: Synthetic multi-turn sessions with tool | ||
| invocations, results, and thinking events serialize and re-parse with exact | ||
| fidelity, asserting that thinking text is removed. | ||
| 2. **Native Language Server Verification**: The official Go binary | ||
| (`language_server`) was executed in an isolated sandbox, queried over Connect-RPC | ||
| (`GetCascadeTrajectorySteps`), and asserted to return all imported steps with | ||
| identical structure. | ||
| 3. **Live User Session Migration**: A live ESPHome voice satellite conversation | ||
| with 256 steps was migrated from Antigravity CLI to Antigravity Desktop, | ||
| confirming complete rendering and sidebar searchability. | ||
|
|
||
| Run the test suite with: | ||
|
|
||
| ```console | ||
| uv run pytest -q tests/test_antigravity_desktop_format.py | ||
| ``` | ||
|
|
||
| Run the native language server oracle (macOS with Antigravity Desktop installed): | ||
|
|
||
| ```console | ||
| uv run pytest -q tests/test_antigravity_desktop_native.py | ||
| ``` | ||
|
|
||
| ## Known boundaries | ||
|
|
||
| - Native oracle hash validation is pinned to official release builds. Unvalidated | ||
| binaries can be tested with `SESSION_MIGRATE_UNVALIDATED_DESKTOP_BIN=1`. | ||
| - Generic tool transport is visually render-proven; internal vendor-privileged tools | ||
| are preserved as generic tool steps to maintain auditability. | ||
| - Private reasoning tokens, system instructions, and ephemeral UI selections are | ||
| not transferred. | ||
| - Subagent conversations are mapped to independent portable sessions with their | ||
| parent reference preserved in metadata. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F3: duplicate
## Unreleasedheading (line 7 and line 9). Merge the new entry under a single Unreleased section.— pi 1.4.0 ·
mistral/mistral-large-4· @xhluca-agent