# \[BUG\] Inline Review Widget collides with VS Code AutoSave & formatters, triggering silent rollback of workspace edits

**URL:** <https://discuss.ai.google.dev/t/bug-inline-review-widget-collides-with-vs-code-autosave-formatters-triggering-silent-rollback-of-workspace-edits/184711>\
**Category:** Google Antigravity\
**Tags:** bug\
**Created:** [September 24, 2026, 2:06pm UTC](https://discuss.ai.google.dev/t/bug-inline-review-widget-collides-with-vs-code-autosave-formatters-triggering-silent-rollback-of-workspace-edits/184711 "2026-09-24T14:06:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prompter\_7452](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/prompter_7452/32/152437_2.png) [@Prompter\_7452](https://discuss.ai.google.dev/u/Prompter_7452)\
**Post date:** [September 24, 2026, 2:06pm UTC](https://discuss.ai.google.dev/t/bug-inline-review-widget-collides-with-vs-code-autosave-formatters-triggering-silent-rollback-of-workspace-edits/184711/1 "2026-09-24T14:06:31Z")

</div>

### Summary

There is a critical architectural issue in Antigravity’s **Turn Transaction & Review Widget** that causes silent code loss and unexpected file rollbacks:

1. **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.
2. **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)`.
3. **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:**

```json
{
  "files.autoSave": "afterDelay",
  "files.autoSaveDelay": 5000,
  "editor.formatOnSave": true,
  "antigravity.autoOpenFiles": false
}

```

* * *

### Reproduction Steps & Empirical Evidence

#### Scenario A: Brand New File Creation (Zero Commands)

1. In a fresh turn, ask the agent to create a new file (e.g. `test_reproduction.txt`).
2. The agent executes `write_to_file`.
3. The chat displays `1 file changed [Review]`, and a floating notification appears above the chat input asking to accept changes.
4. Antigravity opens the live editor buffer with an inline diff overlay.
5. **Do not click anything.** Within 1–3 seconds, AutoSave triggers or focus shifts, and the review notification auto-dismisses.
6. **Result on disk:** The file was written with content at `18:16:32`, but at `18:16:43` (11 seconds later), it was overwritten to **0 bytes (empty file)**:

```powershell
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

1. In another project, the agent modified two `.gitignore` files.
2. The user accepted the review and **committed the changes to Git**.
3. Later, the user scrolled up in chat and clicked the old `[Review]` button on that prior turn.
4. An editor window popped up asking for confirmation, flashed for a split second, auto-dismissed, and **destructively reverted the committed `.gitignore` files back to their state before yesterday’s task**.

* * *

### Attached Video Recordings

1. **[Test 1](https://www.awesomescreenshot.com/video/56833207?key=adf13c431aa375ffb3139fd86ee11487)** (Showing the review prompt auto-dismissing and wiping new files to 0 bytes)
2. **[Test 2](https://www.awesomescreenshot.com/video/56832180?key=59c42d7cccf51add1347d12d8f5fcc0d)** (Showing the re-trigger rollback behavior on historical turns)

* * *

### Suggested Fixes for the Engineering Team

1. **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.
2. **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.
3. **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 ✓]`).
4. **Pause AutoSave During Active Review:** If inline diff overlays must be used, Antigravity should programmatically suspend VS Code’s `files.autoSave` and `editor.formatOnSave` events on the affected documents while a review prompt is active.

* * *

---

<div class="post-metadata">

**Author:** ![Ambati\_Rajendra](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/ambati_rajendra/32/31584_2.png) [@Ambati\_Rajendra](https://discuss.ai.google.dev/u/Ambati_Rajendra)\
**Post date:** [September 30, 2026, 10:29am UTC](https://discuss.ai.google.dev/t/bug-inline-review-widget-collides-with-vs-code-autosave-formatters-triggering-silent-rollback-of-workspace-edits/184711/2 "2026-09-30T10:29:52Z")

</div>

Hi @Prompter_7452,

Could you please share more information:

- Does this same issue appear for all models, or only for the Gemini model?
