This utility provides a robust, cross-platform patch for the Antigravity IDE (VS Code based) that automates common UI interactions to keep your AI agents running smoothly.
When working with AI agents or long-running tasks in Antigravity, you might encounter transient network failures, quota limits, or "Running" hangups. This script automates the process of clicking "Retry", "Allow", and "Run" buttons, and even handles situations where the agent appears to be stuck.
- Auto-Retry: Automatically clicks "Retry", "Try Again", or "Wiederholen" buttons.
- Auto-Continue (Recovery Sequence): Monitors the "Running..." state. If it persists for more than 30 seconds, the script automatically:
- Clicks Cancel.
- Waits 3 seconds.
- Types "continue" into the chat input.
- Waits 3 seconds.
- Clicks Send.
- Auto-Allow: Automatically clicks "Allow" buttons.
- Auto-Run: Automatically clicks "Run" buttons.
- Interactive Configuration: Choose exactly which features to enable during installation.
- Cross-Platform Support: Works on Windows, Linux, and macOS.
- Auto-Detection: Automatically finds the Antigravity installation path.
- Safety First:
- Automatically creates a backup (
workbench.html.bak) before making changes. - Safely modifies the Content Security Policy (CSP) to allow the injection.
- Handles elevation (sudo/Admin) elegantly.
- Automatically creates a backup (
- Node.js: You must have Node.js installed on your system.
- Antigravity IDE: The IDE must be installed.
Open your terminal or command prompt in the folder containing applyAutoRetryContinueAllowPatch.js and execute:
sudo node applyAutoRetryContinueAllowPatch.js(The script will also attempt to call sudo internally if you forget, but it's recommended to run it with privileges directly.)
- Right-click your terminal (PowerShell or Command Prompt) and select "Run as Administrator".
- Run:
node applyAutoRetryContinueAllowPatch.js
The script will present a menu. Choose the desired combination of features:
- All (Retry + Continue + Allow + Run) [Default]
- Retry + Continue + Allow
- Retry + Allow ...and more.
After the script reports success, simply restart the Antigravity IDE. The selected logic will now be active in the workbench.
The script injects a small, lightweight JavaScript snippet into the workbench.html file. This snippet:
- Runs in the main UI thread.
- Scans for buttons and monitors state every 100ms.
- Checks for specific button text (case-insensitive) and uses
WeakSetto ensure each button is clicked only once when appropriate. - Tracks the duration of the "Running" state to trigger the recovery sequence if a timeout is reached.
If you ever want to revert the patch:
- Locate the
workbench.html.bakfile in the same directory whereworkbench.htmlwas found. - Delete the patched
workbench.htmland renameworkbench.html.bakback toworkbench.html.
Distributed under the MIT License. See LICENSE for more information.