Summary
There is a critical architectural issue in Antigravity’s Turn Transaction & Review Widget that causes silent code loss and unexpected file rollbacks:
- Active Buffer Conflict with AutoSave: Instead of immediately opening diffs in an isolated, read-only virtual diff document (like standard VS Code Source Control does), Antigravity initially renders interactive red/green diff decorations directly inside the live, active file buffer. When VS Code’s
"files.autoSave": "afterDelay"or"editor.formatOnSave"fires on that buffer, it writes to disk during an active review. Antigravity detects an external buffer change, the floating review prompt immediately crashes/auto-dismisses after 1–2 seconds, and Antigravity’s fail-safe treats this as a REJECT, silently reverting existing files or truncating new files to 0 bytes. - Inconsistent Review Presentation: On the 1st trigger/turn end, Antigravity injects the volatile inline overlay into the editable file. However, clicking the
[Review]button a 2nd or 3rd time switches behavior and opens the intended virtual editor:Diff: <filename> (Resolved). - Historical Review Button Re-Trigger: Clicking
[Review]on older, completed chat turns re-opens a stale review transaction against the live file, immediately encounters a conflict, auto-dismisses, and destructively rolls back already-committed files to their ancient pre-task state.
Environment Details
- IDE / Host: Antigravity for Visual Studio Code, Windows 11 x86_64
- Shell: PowerShell 7 (
pwsh) - Relevant VS Code Settings:
{
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 5000,
"editor.formatOnSave": true,
"antigravity.autoOpenFiles": false
}
Reproduction Steps & Empirical Evidence
Scenario A: Brand New File Creation (Zero Commands)
- In a fresh turn, ask the agent to create a new file (e.g.
test_reproduction.txt). - The agent executes
write_to_file. - The chat displays
1 file changed [Review], and a floating notification appears above the chat input asking to accept changes. - Antigravity opens the live editor buffer with an inline diff overlay.
- Do not click anything. Within 1–3 seconds, AutoSave triggers or focus shifts, and the review notification auto-dismisses.
- Result on disk: The file was written with content at
18:16:32, but at18:16:43(11 seconds later), it was overwritten to 0 bytes (empty file):
Get-Item test_reproduction.txt | Select-Object Name, Length, LastWriteTime
# Name: test_reproduction.txt
# Length: 0
# LastWriteTime: 9/24/2026 6:16:43 PM
Scenario B: Inconsistent Diff Presentation (1st click vs 2nd/3rd click)
- On the 1st trigger / turn finish, Antigravity attempts the volatile inline overlay inside the file buffer (which causes the AutoSave collision).
- When clicking the
[Review]button a 2nd or 3rd time, Antigravity properly opens the safe, isolated virtual document tab:Diff: <filename> (Resolved).
Scenario C: Re-clicking Historical [Review] Reverts Committed Code
- In another project, the agent modified two
.gitignorefiles. - The user accepted the review and committed the changes to Git.
- Later, the user scrolled up in chat and clicked the old
[Review]button on that prior turn. - An editor window popped up asking for confirmation, flashed for a split second, auto-dismissed, and destructively reverted the committed
.gitignorefiles back to their state before yesterday’s task.
Attached Video Recordings
- Test 1 (Showing the review prompt auto-dismissing and wiping new files to 0 bytes)
- Test 2 (Showing the re-trigger rollback behavior on historical turns)
Suggested Fixes for the Engineering Team
- Make
Diff: <filename> (Resolved)the Default from the 1st Presentation: Since the 2nd/3rd click already opens the safe, isolated virtual diff tab, make this the standard presentation from the very beginning. Never inject volatile inline diff markers directly into the user’s active, auto-saving document buffer. - Default to “Keep Files” (Non-Destructive Failure): If a review window auto-dismisses, loses focus, or encounters a timeout, NEVER discard or truncate files on disk. The edits must remain on disk unless the user explicitly clicks a red “Discard / Revert All Changes” button.
- Lock / Deactivate Historical Review Buttons: Once a turn’s changes are accepted or a new prompt begins, grey out or lock the
[Review]button in that historical turn’s chat bubble (mark as[Reviewed ✓]). - Pause AutoSave During Active Review: If inline diff overlays must be used, Antigravity should programmatically suspend VS Code’s
files.autoSaveandeditor.formatOnSaveevents on the affected documents while a review prompt is active.