Sonu Sahani logo
Sonusahani.com
How to fix Browser agent not working in Antigravity?

How to fix Browser agent not working in Antigravity?

0 views
4 min read
#Solutions

Clicking the Antigravity browser icon does nothing, and asking the agent to open a browser returns an error. The fastest fix is to set the missing HOME environment variable on Windows so Playwright can start.

How to fix Browser agent not working in Antigravity?

In Antigravity on Windows, the in-app browser fails to start. Symptoms include: clicking the browser icon does nothing, and the agent replies that there was an error. In logs, you may see messages like: “Playwright failed to initialize because the $HOME environment variable is not set.”

How to fix Browser agent not working in Antigravity?

Solution Overview

AspectDetail
Root CausePlaywright can’t initialize because the Windows session lacks a HOME environment variable, which it needs to store browser binaries, cache, and profiles.
Primary FixSet HOME to your Windows user profile path (same as USERPROFILE).
ComplexityEasy
Estimated Time3–5 minutes

If the agent still stalls after fixing HOME, see this quick tip to recover thinking loops: when Antigravity stops thinking around 1024 tokens.

How to fix Browser agent not working in Antigravity?

Step-by-Step Solution

Method 1 — Set HOME via PowerShell (Recommended)

  1. Open PowerShell (as your regular user).
  2. Set HOME to your profile:
[Environment]::SetEnvironmentVariable("HOME", $env:USERPROFILE, "User")
  1. Close and reopen Antigravity (and any IDE/terminal) so the new variable is picked up.
  2. Verify:
$env:HOME

It should print something like C:\Users\YourName.

Method 2 — Set HOME via Windows Settings

  1. Open “Edit the system environment variables” → Environment Variables.
  2. Under “User variables”, click New and add:
  • Variable name: HOME
  • Variable value: %USERPROFILE%
  1. Click OK on all dialogs.
  2. Restart Antigravity (and your IDE/terminal) to reload environment variables.

Confirm the fix

  • Reopen Antigravity and click the browser icon. It should now open a Playwright-powered browser context.
  • If prompted on first run, Playwright may download Chromium to:
  • C:\Users\YourName\AppData\Local\ms-playwright

Alternative Fixes & Workarounds

Set HOME only for an Antigravity launcher (no global change)

  • Create a batch file next to your Antigravity shortcut:
@echo off
set "HOME=%USERPROFILE%"
start "" "C:\Path\To\Antigravity\Antigravity.exe"
  • Launch Antigravity via this .bat so it always has HOME.

Point Playwright to a custom browsers folder

  • If HOME must remain unset globally, set a per-user path for browsers:
[Environment]::SetEnvironmentVariable("PLAYWRIGHT_BROWSERS_PATH", "$env:LOCALAPPDATA\ms-playwright", "User")

If you’re also blocked by account checks in Antigravity, review this quick fix: account not eligible error.

Troubleshooting Tips

  • Verify HOME is actually set for your user:
[Environment]::GetEnvironmentVariable("HOME","User")
[Environment]::GetEnvironmentVariable("HOME","Process")
  • Check folder permissions:
  • Ensure you have write access to %USERPROFILE% and %LOCALAPPDATA%\ms-playwright.
  • Force a clean Playwright cache (downloads will reoccur on next run):
rmdir /s /q "%LOCALAPPDATA%\ms-playwright"
  • Restart the app completely after any env change (variables are read at process start).
  • Corporate environments: antivirus or endpoint controls may block browser downloads. Temporarily allow or whitelist:
  • %LOCALAPPDATA%\ms-playwright
  • Still crashing? You might be hitting a separate agent crash case; see this guide: agent terminated due to error.

Best Practices

  • Always keep a valid HOME set for Windows user sessions that run developer tools.
  • Standardize HOME via a user-level environment variable across dev machines.
  • Pre-create and grant write access to %LOCALAPPDATA%\ms-playwright.
  • Document HOME in your team’s Antigravity setup steps and CI/virtual desktops.
  • After big OS or policy changes, re-check HOME and browser cache paths.
  • For thinking stalls or token cutoffs in long sessions, see this quick aid: fix for thinking stops near 1024 tokens.

Final Thought

This issue is almost always caused by a missing HOME variable on Windows. Set HOME to %USERPROFILE%, restart Antigravity, and the browser agent should start working within minutes.

Subscribe to our newsletter

Get the latest updates and articles directly in your inbox.

sonuai.dev

Sonu Sahani

AI Engineer & Full Stack Developer. Passionate about building AI-powered solutions.

Related Posts