[Bug] Antigravity agent hangs indefinitely on "Running..." after command approval

I’m running into an issue with the Antigravity agent where it gets stuck in a perpetual “Running…” state. Whenever the agent proposes a command and I approve it, the execution hangs indefinitely until I manually force stop it. No output or error message is returned.

Troubleshooting Steps Already Taken: I have searched for similar issues and tried the following workarounds, but none have resolved the problem:

  • Added cmd /c to Global Rules: I updated my .antigravityrules file to force the agent to use cmd /c for shell executions, hoping to ensure the terminal terminates the process and sends an EOF signal.

  • Switched default terminal to PowerShell: I changed the default terminal to PowerShell (Core, not Windows PowerShell) in the settings, as I read this helps the agent correctly interpret Unix-like commands.

  • Cleared Cache and Configs: I completely cleared the local cache and configuration files in my AppData folder to rule out corrupted state data.

Is anyone else experiencing this, or are there any known fixes or debugging flags I can enable to see where it’s hanging? Any help would be greatly appreciated!

3 Likes

Hello @ece_lazar, welcome to AI Forum!
Thank you for bringing the issue to our attention. Our engineering team is currently investigating the matter, and we appreciate your patience as we work toward a resolution.

2 Likes

Having similar issue on MAC

I’m experiencing the same issue. Gemini is trying to execute long-chained grep commands or in-line node scripts, and no matter what, after a long conversation, it starts to get stuck. I’ve tried restarting the IDE, and it sometimes works, but after some messages, the same thing happens.

Do you guys know a way to get traces to ease the debugging process of AG devs?

Something I’ve noticed is that when the command execution hangs, the command being executed appears cut off at the end. That might cause the command stream to never properly terminate, so the command never actually executes even though the Antigravity flow is waiting for the result. It ends up stuck in a sort of deadlock-like state.

Confirming on macOS — with log analysis pointing to a BigInt serialization crash in main.js

Environment: macOS (Apple Silicon), Antigravity Desktop 1.19.6, Gemini 3.1 Pro (High)

I can reproduce this reliably. The agent hangs at “Running..” after approving terminal commands, particularly when multiple CLI commands are fired in quick succession. The agent never receives the terminal output and sits indefinitely.

I dug into the logs under ~/Library/Application Support/Antigravity/logs/ and found a clear sequence of events:

1. ptyHost heartbeat loss (main.log):

00:31:38.769 [warning] No ptyHost heartbeat after 6 seconds
00:31:43.792 [error] No ptyHost heartbeat after 12 seconds

2. Uncaught BigInt serialization crash in the main process (main.log):

00:32:58.496 [error] [uncaught exception in main]: TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at xC (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:11765)
    at vbe.o (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:14636)
    at vbe.m (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:14511)
    at n.then.Error.m.id (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:15438)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

3. Terminal completion signals stop (Antigravity.log — window-level):

Before the hang, terminal completions are logged normally:

00:31:21.626 [INFO]: [Terminal] Command completed: python3 <script> exit code 0
00:31:34.080 [INFO]: [Terminal] Command completed: cd /Users/<user>/ exit code 0

After the BigInt crash, no more [Terminal] Command completed entries appear for the rest of the session — the agent fires additional commands, but their results are never delivered back.

4. The planner spins indefinitely — the language server keeps requesting planner cycles with an ever-growing message count (27 → 29 → 31 → 33 → … → 48 → 50 → 51), waiting for terminal output that will never arrive.

5. Additional noise in the logs:

  • Clearcut responded with HTTP code 413 (telemetry payload too large, likely from the ballooning conversation context)
  • Too many changes in DidChangeWatchedFiles: 1150 repeating every ~5 minutes (workspace file watcher flood)
  • [consumeAgentStateStream] streamAgentStateUpdates error: ConnectError: [unknown] Failed to fetch in the agent window console

Summary: It looks like a BigInt value somewhere in terminal process metadata (possibly a PID or timestamp) is being passed through JSON.stringify without a replacer, which throws an uncaught exception and breaks the IPC between the terminal and the agent. The ptyHost heartbeat loss immediately before the crash suggests the terminal host process is already struggling before the serialization error kills the communication channel entirely.

This is reproducible across sessions. The trigger in my case is the agent running multiple sequential Python CLI commands in the integrated terminal, but based on the other reports here (grep chains, inline Node scripts), it seems like any sustained terminal activity can trigger it.

1 Like

Update: Found the root cause and a working patch

Following up on my earlier post - I dug into the Antigravity desktop logs and identified the cause of the hang, then applied a one-line patch to main.js that fixes it. The same workflow that hung 3 times in a row completed successfully on the first attempt after patching.


Root Cause

The hang is caused by an uncaught TypeError: Do not know how to serialize a BigInt in the main Electron process. This crashes the IPC channel between the integrated terminal and the agent, so terminal command results are never delivered back. The agent then sits at “Running..” forever, waiting for output that will never arrive.

The crash sequence visible in the logs:

Step 1 — ptyHost heartbeat loss (main.log):

[warning] No ptyHost heartbeat after 6 seconds
[error] No ptyHost heartbeat after 12 seconds

Step 2 — BigInt serialization crash (main.log):

[error] [uncaught exception in main]: TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at xC (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:11765)
    at vbe.o (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:14636)
    at vbe.m (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:14511)
    at n.then.Error.m.id (file:///Applications/Antigravity.app/Contents/Resources/app/out/main.js:31:15438)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Step 3 — Terminal completions stop entirely (Antigravity.log, window-level):

Before the crash, completions log normally:

[INFO]: [Terminal] Command completed: python3 <script> exit code 0

After the crash, no more [Terminal] Command completed entries appear for the rest of the session.

Step 4 — Agent spins indefinitely:

The language server keeps requesting planner cycles with an ever-growing message count (27 → 31 → 33 → … → 48 → 51), waiting for terminal output that will never arrive. This is the “Running..” state visible in the UI.


The Fix (one-line patch)

The crash occurs in the xC function in main.js, which serializes values for IPC transport. It calls JSON.stringify(t) on arbitrary values, but JSON.stringify throws on BigInt values because it doesn’t natively support them.

File: /Applications/Antigravity.app/Contents/Resources/app/out/main.js (macOS)

Find this string (there is exactly one occurrence):

sn.fromString(JSON.stringify(t))

Replace with:

sn.fromString(JSON.stringify(t,(k,v)=>typeof v==="bigint"?Number(v):v))

This adds a replacer function that converts BigInt values to Number before serialization. All realistic values flowing through this path (PIDs, timestamps, byte counts) fit safely within Number.MAX_SAFE_INTEGER (9 quadrillion), so there is no precision loss.

On macOS, the full steps are:

  1. Quit Antigravity completely

  2. Back up the original file:

    cp "/Applications/Antigravity.app/Contents/Resources/app/out/main.js" \
       "/Applications/Antigravity.app/Contents/Resources/app/out/main.js.backup"
    
  3. Apply the patch:

    sed -i '' 's/sn\.fromString(JSON\.stringify(t))/sn.fromString(JSON.stringify(t,(k,v)=>typeof v==="bigint"?Number(v):v))/' \
       "/Applications/Antigravity.app/Contents/Resources/app/out/main.js"
    
  4. Relaunch Antigravity

To revert:

cp "/Applications/Antigravity.app/Contents/Resources/app/out/main.js.backup" \
   "/Applications/Antigravity.app/Contents/Resources/app/out/main.js"

Results

Before patch: Agent hung at “Running..” on every attempt involving multiple sequential terminal commands (3 consecutive failures on the same workflow).

After patch: The exact same workflow — 17 sequential CLI calls (label-delete and filter-delete operations) — completed successfully on the first attempt. main.log shows zero BigInt errors, zero ptyHost heartbeat loss, and all terminal completions were delivered back to the agent normally.


Environment

  • macOS (Apple Silicon), Antigravity Desktop 1.19.6
  • Gemini 3.1 Pro (High)

Notes

  • The code signature on the app bundle will be invalidated by this edit. In my experience, macOS still launches the app without issues since it was already trusted via Gatekeeper on first install. You may see a one-time confirmation prompt.
  • Any Antigravity auto-update will overwrite main.js, so you would need to re-apply the patch after updating.
  • The same JSON.stringify pattern likely exists in the Windows build at an equivalent path — Windows users experiencing this issue could apply the same fix.

Log Locations for Others Investigating

  • macOS: ~/Library/Application Support/Antigravity/logs/<session>/
    • main.log — look for BigInt or ptyHost heartbeat
    • window*/exthost/google.antigravity/Antigravity.log — look for [Terminal] Command completed entries stopping
1 Like