[Antigravity IDE] Extension crash and WebSocket connection closed unexpectedly (Close Code 1006 / Exit Code 2)

Description of the issue: I am experiencing a recurring crash in the Antigravity IDE extension. When loading a workspace or during usage, the extension fails to maintain its WebSocket connection, resulting in a sudden disconnect, error code 1006, and subsequently crashing the backend server process with exit code 2.

Steps to reproduce:

  1. Open Antigravity IDE and load a workspace directory.

  2. The extension attempts to spawn the backend binary (agy.exe) and check health endpoints.

  3. Shortly after initialization, the WebSocket connection drops unexpectedly with close code 1006, followed by the extension host crashing.

Environment:

  • IDE Version: Antigravity IDE v2.32.2

  • Extension Version: v1.5.9 (agy)

  • OS: Windows 11 (Electron / Desktop)

Error Logs / Console Output:

main.js:23564 [ConversationLoad] Cold load completed: 2802ms
main.js:23564 [ProjectUpdates] Disconnected
console.warn @ main.js:23564
onDisconnect @ main.js:18684
Li @ main.js:1601
main.js:23564 [plugins_fetch_failed] ConnectError: [unavailable] WebSocket connection closed unexpectedly (close code 1006)
at O1 (main.js:12988:189)
at k.onclose (main.js:12996:466)
console.error @ main.js:23564
rq @ main.js:2256
(anonymous) @ main.js:3062
onError @ main.js:11700
Li @ main.js:1601
main.js:23564 [consumeAgentStateStream] streamAgentStateUpdates error: ConnectError: [unavailable] WebSocket connection closed unexpectedly (close code 1006)
at O1 (main.js:12988:189)
at k.onclose (main.js:12996:466)
console.error @ main.js:23564
kda @ main.js:1174
workbench.desktop.main.js:2802 ERR [Extension Host] [LAUNCH ERROR] Server process exited unexpectedly with code 2, signal null
error @ workbench.desktop.main.js:2802
error @ workbench.desktop.main.js:2802
error @ workbench.desktop.main.js:8120
jmu @ workbench.desktop.main.js:4702
$logExtensionHostMessage @ workbench.desktop.main.js:4702
_doInvokeHandler @ workbench.desktop.main.js:8164
_invokeHandler @ workbench.desktop.main.js:8164
_receiveRequest @ workbench.desktop.main.js:8164
_receiveOneMessage @ workbench.desktop.main.js:8164
(anonymous) @ workbench.desktop.main.js:8164
_deliver @ workbench.desktop.main.js:2793
fire @ workbench.desktop.main.js:2793
fire @ workbench.desktop.main.js:4736
l.onmessage @ workbench.desktop.main.js:8175
VM9 bridge.js:2422 Unknown message from iframe: {source: ‘antigravity-error’, type: ‘recovering’, attempt: 2, maxAttempts: 3, reason: ‘process_exit_nonzero’}
workbench.desktop.main.js:4702 [Extension Host] [LAUNCH] Spawning C:\Users\ryana.gemini\bin\agy.exe (v1.5.9) --hub --hub-port=51068 --app_data_dir=antigravity --csrf_token=f242df18-19be-476a-8344-426cb7cc7d14 --add-dir=c:\Projeto Cliente\novo sistem
workbench.desktop.main.js:4702 [Extension Host] [LAUNCH POLL 1] Error connecting to http//127.0.0.1:51068/healthz: connect ECONNREFUSED 127.0.0.1:51068
workbench.desktop.main.js:4702 [Extension Host] [LAUNCH] Server at http//127.0.0.1:51068 is READY after 2 attempt(s).
workbench.desktop.main.js:4702 [Extension Host] [Jetski] Loading iframe URL: http//127.0.0.1:51068/c/24ffb705-8a33-411f-aae8-9e27ce392f4c?extensionView=true&extensionVariant=vs-code&hostVariant=antigravity-ide&hostVersion=1.11.0&ideVersion=1.107.0&useWebSocket=true&hostTheme=dark&enableMicrophone=false&platform=electron&isEnterpriseDisabled=true&hideWelcomePrefix=true&defaultGroupByNone=true&workspaceUri=file%3A%2F%2F%2Fc%253A%2FProjeto%2520Cliente%2Fnovo%2520sistem
bridge.js:248 [Jetski] PostMessageTransport error: {type: ‘postmessage-rpc’, channel: ‘agy-ext-antigravity-api’, requestId: 4, rpcPath: ‘/gemini_coder.agent_ui_toolkit.iframe.AntigravityApi/ListCommands’, error: true, …}
workbench.desktop.main.js:2802 ERR [Extension Host] [Jetski] Failed to list and register commands ConnectError: [not_found] Endpoint /gemini_coder.agent_ui_toolkit.iframe.AntigravityApi/ListCommands not implemented
at c:\Users\ryana\AppData\Local\Programs\Antigravity IDE\resources\app\extensions\agy\vscode\extension.js:24689:349
at nf.value (c:\Users\ryana\AppData\Local\Programs\Antigravity IDE\resources\app\extensions\agy\vscode\extension.js:27145:583)

Hi @Ryan_Nascimento ,

Welcome to the Forum, and thank you for the detailed report and logs.

The logs show the backend (agy.exe v1.5.9) starting, reporting READY, and then exiting with code 2. The WebSocket 1006 errors are a result of that exit rather than a separate problem, and the ListCommands not implemented message is harmless and unrelated.

To find out why the backend exits, could you share the following:

  1. The crash log: right after a crash, and before the IDE next starts successfully, look in %USERPROFILE%\.gemini\antigravity\crashes\ for a crash__.log file. These are removed on the next successful startup.

  2. The backend log: cli.log in %USERPROFILE%\.gemini\antigravity\.

  3. Scope: does this happen in every workspace, or only in c:\Projeto Cliente\novo sistem? Does a new empty folder also crash?

  4. History: did it start after an update, or after any conversation or session files were deleted manually?

You can also click Report issue on the error screen to send the logs to us directly.

One thing you can try in the meantime: close the IDE fully, then rename (rather than delete) conversation_summaries.db and agyhub_summaries_proto.pb in %USERPROFILE%\.gemini\antigravity\, and start the IDE again so the index rebuilds. This has helped in a similar case, though it may not apply to yours.

Please let us know what you find.