The Issue:
When trying to do simple find-and-replace operations (like changing color variable names), the tool consistently corrupts files instead of making clean replacements. Even when the AI views the exact content first and uses character-for-character matching, the replacement fails and leaves broken code.
What I'm seeing:
– Trying to replace a simple 5-line block in a JavaScript config
– AI uses `view_file` to get the exact content
– AI calls `replace_file_content` with the exact `TargetContent`
– Result: File gets corrupted – entire config block replaced with just empty closing braces
– This happens **consistently** – 4 failures in a row on the same simple task
Example pattern:
```javascript
// Before (what should be replaced):
colors: {
'var-one': '#123456',
'var-two': '#abcdef',
},
// After (what actually happens):
}
}
}
```
The entire structure gets destroyed, leaving only closing braces.
What I've tried:
– Viewing exact content before replacement ✗
– Using exact character-for-character matches ✗
– Updating Antigravity to latest version ✗
– Turning off planning mode ✗
Environment:
– OS: Windows
– File type: HTML with embedded JavaScript
– Line endings: CRLF (standard Windows)
Question:
Is anyone else experiencing this? Is there a known workaround? This is a showstopper bug, if the tool can't do basic find-and-replace without corrupting files, it's hard to trust it for any code editing tasks.
I've already submitted a bug report through Antigravity, but wanted to check if this is a widespread issue or if there's something specific about my setup causing this.