u/Independent_Way_6100

[Bug] Agent can't connect to WSL workspace [folder]

Hey everyone, I’m running into a frustrating issue with Antigravity when trying to work inside WSL, and I'm hoping someone has a permanent workaround or if the devs are aware of this.

The Problem: Antigravity works perfectly fine on Windows. However, the moment I select a specific folder or repo inside my WSL distro, the AI agent completely hangs and stops responding. The UI just stays stuck on "Generating & Working...".

What I've noticed:

1. Wrong Host Environment: The agent thinks it's still sitting in Windows. For example, if I ask it to run a command in my Linux path, instead of just running mkdir -p /home/user/test natively inside the WSL shell, it tries to bridge it through PowerShell using wsl mkdir.... It doesn't seem to natively mount the agent backend inside the WSL workspace.

2. The Background Loop (Diagnostic Info): I checked the background diagnostics, and it looks like the agent is trapped in an infinite loop causing it to crash. There are 4 main culprits happening at once:

  • Stale Tunnel Daemon (Port Mismatch): When switching folders, a new server starts in WSL on a new port, but the WSL tunnel proxy (wslDaemon.js) never updates. It keeps trying to route to the old port, resulting in a WebSocket error 1006.
  • Out of Memory (OOM): Node.js quickly eats up the WSL RAM allocation, and the Linux OOM killer silently terminates the agent server in the background.
  • Zombie Processes: Every time the agent hangs, it spawns a new process without killing the old one, eating up GBs of RAM and creating a feedback loop.
  • No Reconnect Timeout: The retry loop has no ceiling. It just retries every 30 seconds forever, which is why there's no error message in the UI.

My Current Workaround: Right now, the only way to get it to respond again is by completely killing WSL from Windows (wsl --shutdown) to clear the zombie processes and stale ports, and then launching the IDE directly from the Linux terminal again.

Has anyone else experienced this specific WSL bug? Are there any config settings in Antigravity to force the agent to attach to the WSL host natively without spawning these infinite zombie tunnels?

Thanks in advance!

reddit.com
u/Independent_Way_6100 — 12 days ago