Bugfix - Antigravity Windows Console Crash Patch

On Windows, the Antigravity desktop applications spawn a backend Go-based language server (language_server.exe) to manage tasks, code analysis, and run commands. Because the Node/Electron host processes and the spawned Go language server share the same console group, any console interrupt signal (such as hitting Ctrl+C in an active terminal or terminating a reloading dev server) propagates to all processes in that console group.

Go’s runtime contains a default signal handler that intercepts CTRL_C_EVENT / SIGINT. When it catches this signal, language_server.exe terminates immediately (usually exiting with code 0).

When the language server crashes or exits:

  1. The Electron frontend loses its IPC connection to the backend.

  2. The UI automatically triggers a page refresh to recover the session.

  3. Your current task execution is abruptly halted, and the screen resets to a new conversation.

This patch resolves the crash by introducing a lightweight Python process wrapper (ls_wrapper.py) that acts as a signal-isolated buffer between Electron and the language server.

How it Works:

  1. Signal Isolation: The wrapper utilizes the Windows API via ctypes to call SetConsoleCtrlHandler(None, 1). This ignores console control events (such as Ctrl+C and Ctrl+Break). Because child processes inherit the signal-handling state of their parent, the nested language_server.exe ignores these console-wide interrupts.

  2. Process Lifecycle Management: Since the standard Ctrl+C signal is ignored, we must prevent orphaned language server processes when the host application closes. The wrapper creates a Windows Job Object configured with JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE and assigns the language server process to it. When the wrapper process is terminated (e.g., when Electron kills its child process), the OS automatically and cleanly terminates language_server.exe.

  3. Log Persistence: By default, the application resets the language server log file on every launch (flags: 'w'). The patch updates this to append mode (flags: 'a') to preserve error diagnostics across app restarts.

Check out my fix here: GitHub - erdometo/antigravity-windows-crash-patch: This repository contains an automated patcher and process wrapper to fix a critical issue in Antigravity 2.0 and the Antigravity IDE on Windows where the application unexpectedly refreshes, resets the UI to a new conversation tab, and interrupts active execution. · GitHub