Repository navigation
Description
What happened
I was running T3 Code on my server, connected through my MacBook Pro, using Antigravity.
One of my local dev scripts starts a local Convex backend, which uses $TMPDIR.
T3 Code sets $TMPDIR (since #12008) to a ~69-byte path, about 65 bytes longer than /tmp. Because Linux enforces a 108-byte path limit for Unix domain sockets, this causes Convex to fail when creating a Unix domain socket with a path over 108 bytes. Convex then hangs in an infinite retry loop, with POST /api/deploy2/start_push returning 500 Internal Server Error.
While you could claim that this is a problem with my project or Convex:
- T3 Code eats ~65% of an OS kernel limit, which could break other common developer tooling.
- Anything an agent runs that puts a Unix socket under
$TMPDIRcould hitEINVAL. - The same project and scripts work under Claude, Codex, Cursor, and normal terminals, and only fail under Antigravity.
Written by me with assistance from Antigravity (Gemini 4 Neon).
Diagnosis
To reclaim Antigravity's ~1 GB PyInstaller _MEI... unpack folders after force-kill, T3 Code sets TMPDIR on the Antigravity ACP process to a per-run directory under stateDir:
apps/server/src/provider/antigravityAuthSupport.ts:193(resolveAntigravityInstanceDirectories) setsruntimeTemptopath.join(stateDir, "antigravity-tmp", key.slice(0, 12)).apps/server/src/provider/Drivers/AntigravityDriver.ts:253creates arun-XXXXXXsubdirectory insideruntimeTemp.apps/server/src/provider/antigravityAuthSupport.ts:236(antigravityEnvironment) setsTMPDIR: tempDirectoryon non-Windows platforms.
Every shell command the Antigravity agent spawns inherits that TMPDIR. With a typical Linux home directory, the path is already ~68 to 75 bytes:
/home//.t3/userdata/antigravity-tmp/ac0a3dfd6ddd/run-Z3MAVm (69 bytes)
Linux caps AF_UNIX sockaddr_un.sun_path at 108 bytes (107 plus NUL), and macOS caps it at 104 bytes. Any tool that creates a temp subdirectory and a Unix domain socket under os.tmpdir() / TMPDIR (such as Convex's local backend, Postgres, tmux, or SSH ControlPath) can exceed the limit and fail with EINVAL.
A comment at antigravityAuthSupport.ts:180 notes runtimeTemp was previously shortened for Windows' 260-character path limit, but the path is still too long for Unix domain sockets. Placing the T3-owned per-run directory under /tmp on Unix (for example /tmp/t3-agy-<uid>/[run-XXXXXX](https://github.com/tmp/t3-agy-%3Cuid%3E/run-XXXXXX) or similar) would keep orphan cleanup while leaving ~80 bytes of headroom for sun_path.
Written by Antigravity (Gemini 4 Neon).
Steps to reproduce
- On Linux, start an Antigravity thread on a T3 Code server with the default
~/.t3/[userdata](https://github.com/home/jamesblair/.t3/userdata)state directory. - In a shell command inside the Antigravity thread, check
TMPDIRand create a Unix domain socket inside a ~22-character temp subdirectory underos.tmpdir():
node -e '
const fs = require("node:fs");
const net = require("node:net");
const path = require("node:path");
const os = require("node:os");
console.log("os.tmpdir() length:", os.tmpdir().length);
const sub = fs.mkdtempSync(path.join(os.tmpdir(), "app-backend-tmp-"));
const sock = path.join(sub, "backend-ipc-123456.sock");
console.log("subdir length:", sub.length, "socket path length:", sock.length);
const srv = net.createServer();
srv.on("error", (err) => {
console.log("listen error:", err.code, err.message);
fs.rmSync(sub, { recursive: true, force: true });
});
srv.listen(sock, () => {
console.log("listen succeeded");
srv.close(() => fs.rmSync(sub, { recursive: true, force: true }));
});
'- Observe
listen error: EINVAL. Re-run withTMPDIR=/tmpand observelisten succeeded.
Written by Antigravity (Gemini 4 Neon).
Version
0.1.11-nightly.20261119.4918
Environment
Linux x64 (6.12.117+deb13-amd64), Node v26.13.1, Antigravity CLI 1.5.12, running as t3code.service systemd user service.
Written by Antigravity (Gemini 4 Neon).
Evidence
$ echo "TMPDIR=$TMPDIR (${#TMPDIR} chars)"
TMPDIR=/home/<user>/.t3/userdata/antigravity-tmp/ac0a3dfd6ddd/run-Z3MAVm (69 chars)
$ node -e '...net.createServer().listen(sock)...'
os.tmpdir() length: 69
subdir length: 91 socket path length: 115
listen error: EINVAL listen EINVAL: invalid argument /home/<user>/.t3/userdata/antigravity-tmp/ac0a3dfd6ddd/run-Z3MAVm/app-backend-tmp-aJo3kT/backend-ipc-123456.sock
# Original Convex local backend repro in the affected thread:
# TMPDIR="$TMPDIR/app-convex-diag01" (91 chars): timed out (exit 124) stuck at "Preparing Convex functions..." (POST /api/deploy2/start_push -> 500)
# TMPDIR="/tmp/app-convex-diag01" (26 chars): finished in 2.47sWritten by Antigravity (Gemini 4 Neon).
Related issues
#33300, #23877, and #11204 cover Antigravity _MEI... temp-dir leaks and cleanup (the reason antigravity-tmp exists), not AF_UNIX socket path overflows caused by TMPDIR length. ###
Written by Antigravity (Gemini 4 Neon).
Fix applied or workaround
Workaround is to override TMPDIR=/tmp when running tools that create Unix domain sockets inside Antigravity shell commands, or fall back to /tmp in project scripts when os.tmpdir() is long.
Written by Antigravity (Gemini 4 Neon).
Filed by
Antigravity (Gemini 4 Neon) via t3 triage
Activity
[-]Antigravity per-run TMPDIR is ~70 bytes and breaks Unix domain sockets in agent shell commands[/-][+]Antigravity TMPDIR is too long (~70 bytes) and breaks Unix domain sockets in agent shell commands[/+]PranavTJ-05 commentedon Nov 19, 2026
Can I take this issue?
PranavTJ-05 commentedon Nov 19, 2026
I have submitted a fix in PR #39061.
Summary of What Was Fixed
Root Cause:
resolveAntigravityInstanceDirectoriesplacedruntimeTempunderstateDir(~/.t3/userdata/antigravity-tmp/<key>/run-XXXXXX), which produces a ~69–75 character base path. Because Linux and macOS kernels capAF_UNIXsockaddr_un.sun_pathat 108 and 104 bytes respectively, tools that create a temporary subdirectory and Unix domain socket underos.tmpdir()/$TMPDIR(e.g. Convex's local backend, PostgreSQL, tmux, or SSHControlPath) produce paths ~115 bytes long, causinglisten()to fail withEINVAL: invalid argument.What Was Done:
platform !== "win32"),resolveAntigravityInstanceDirectoriesnow placesruntimeTempunder/tmp/t3-agy-<uid>/<key.slice(0, 6)>(falling back to/tmp/t3-agyifuidis unavailable).TMPDIRpath to ~34 characters, leaving ~74 bytes of headroom on Linux and ~70 bytes on macOS—preventing socket path truncation andEINVAL.runtimeTempremains understateDir(path.join(stateDir, "antigravity-tmp", key.slice(0, 12))) to prevent long extracted paths from exceeding Windows' 260-characterMAX_PATHlimit.AntigravityDrivernow also sweepslegacyRuntimeTempunderstateDiron POSIX so that previous runs left over in~/.t3/userdata/antigravity-tmpare cleaned up on startup.antigravityAuthSupport.test.tsverifying thatruntimeTempon POSIX keeps the total socket path well below the 104-byte limit.MAX_PATHtests, session cleanup tests, and driver tests pass.Nils-2m commentedon Nov 23, 2026
Another common way to hit this: headless Chromium / Google Chrome abort on startup when an Antigravity agent runs them, e.g. to render HTML to PDF (
--headless=new --print-to-pdf=...). The browser dies with SIGABRT before loading the page:Chromium creates its process-singleton socket in a
mkdtempdirectory under$TMPDIR, even with--headlessand a custom--user-data-dir. With the current AntigravityTMPDIR, that path islen($HOME) + 98bytes for Chromium (org.chromium.Chromium.XXXXXX) andlen($HOME) + 94for Chrome (com.google.Chrome.XXXXXX), against the 107-bytesun_pathlimit. So Chromium fails for any$HOMElonger than 9 bytes (that is, every normal/home/<user>), and Chrome fails once the user name is 8 or more characters.Repro (Linux, inside an Antigravity thread)
The same happens with
google-chrome-stable. Outside T3 (normal terminal, Claude Code, Codex), the same command works.Agents that hit this often retry with a different approach, so the visible symptom is usually just a systemd-coredump crash notification for
chromium, with no clear link back to T3.Environment
t3 serveas a systemd user service), Antigravity ACP runtime 1.4.5, Google sign-inWorkaround until #39060 lands
A wrapper earlier on
PATH(e.g.~/.local/bin/chromium) that resetsTMPDIRwhen it is long:The
/tmp/t3-agy-<hash>link in #39060 (~35-byteTMPDIR) would leave about 25 bytes of headroom for Chromium's singleton socket, so that PR should fix this case too.iHat3Microsoft commentedon Nov 25, 2026
Another occurrence on 0.1.7, this time not in a shell command but in an Antigravity ACP run taking a headless Chromium screenshot — so
--screenshotis affected too, and the abort is provable from the process's own log buffer:t3code-bin, Arch/Omarchy), Antigravity provider, Chromium 154.0.8037.97, 2026-11-25 05:03:28 MSK, PID 486331, SIGABRT (SI_TKILL), unitt3code-acp-…scope.TMPDIR= 67 chars, socket path = 112 vs the 107-byte limit (sun_path[108]incl. NUL). Chromium needs 44 extra bytes belowTMPDIR(/org.chromium.Chromium.XXXXXX/SingletonSocket), so this fails for any$HOMElonger than ~4 bytes — i.e. always, with or without--headless,--user-data-diror--no-sandbox, sinceProcessSingleton::Create()alwaysmkdtemps under$TMPDIR(https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/process_singleton_posix.cc).TMPDIR=/tmp. Cores are stripped (Arch ships no debuginfo), and the only FATAL string in the core is the one above — no other failure mode involved.One thing the fix should budget for: the
run-XXXXXXcomponent is added by the Antigravity runtime inside whateverTMPDIRit is given, so the useful constraint islen(TMPDIR) + 44 <= 107./tmp/t3-agy-<uid>/<6-hex>from #39060 gives ~33 → ~77 total, which is fine; the WindowsMAX_PATHreasoning for keepingstateDirdoes not apply on POSIX.juliusmarminge commentedon Nov 30, 2026
Fixed by #45979, now on main: Antigravity shells now inherit the host temp environment instead of the long antigravity-tmp run path, so the reported Linux Convex/socket probe and Chromium commands can run with the same temp path as a normal terminal without a TMPDIR workaround.