Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — Every existing Windows Antigravity launch now uses a rewritten temp environment and a new owned-directory lifecycle, including cross-process orphan reclamation and retrying filesystem deletion. This is a substantial runtime behavior and cleanup-side-effect change rather than a small isolated fix, so the lifecycle and failure behavior merit human review. You can add or adjust custom eligibility rules. Learn more. |
|
We hit the matching Windows Temp accumulation on Nightly We preserved the folder metadata and sampled hashes before manual cleanup. The detailed report is in #9650 (comment). Adding this as another affected installation and a data point from the September 7 Nightly. We haven't tested this PR's changes, so this is confirmation of the existing problem, not validation of the fix. |
|
encountered this also. Disabled antigravity |
|
+1 — hit this in the wild, with numbers. Windows 11, t3code with the Antigravity agent enabled. Found 145 orphaned Data points that may help:
Worth noting: on a second PC this was never a problem. That machine has Antigravity 2.12.2 installed too, but doesn't run t3code — after weeks of regular use it has zero Temporary mitigation we're running locally: a small janitor that deletes |
|
Codex here, posting for this account’s owner. We also see this on nightly |
|
Another affected install, plus two mechanism data points that support this PR's approach over a "shut it down gracefully" alternative, and one question about the reclaim rule. Environment: Windows 11 Pro 26200, T3 Code v0.0.40 (stable channel), managed runtime Why containing the extraction looks right, rather than trying to stop the process cleanly. I ran the bundled
So every caller ends up force-killing it, and cleanup has to be owned by the caller, which is what this PR does. Redirecting Question on Haven't built this branch: this is confirmation plus a code read, not validation of the fix. |
|
Confirming this is needed, and the Windows leak is already huge in the wild. On a 454 GB C: with the managed Antigravity provider enabled and the default 5-minute health interval, T3 left 148 A scoped TEMP/TMP directory that T3 actually deletes after Thanks for taking this — please merge it. |
…folders (#12008) The health probe launched the PyInstaller ACP binary every minute and force killed it, leaving about 1 GB of _MEI files per run. The probe now resolves the install on disk without spawning. Each ACP process gets its own temp directory under the profile that is removed when the runtime closes, and the driver sweeps the profile temp root on create. Continues #11657 by Vita Skacel. Owned temp directory approach from #9626 by ariszz. Co-authored-by: Vita Skacel <skacel.vita@gmail.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
|
Superseded by #12008, which shipped the per-process owned temp directory approach credited from this PR (without system-temp sweeps). Closing this as superseded. |
What Changed
On Windows, run each Antigravity ACP process with an isolated runtime temp directory and remove that directory when the runtime shuts down.
Before allocating a new runtime directory, cleanup reclaims directories left by terminated T3 server processes after verifying an ownership marker that binds the directory name and owner PID. Cleanup retries transient filesystem failures, while unmarked directories, mismatched markers, and directories belonging to active T3 processes are preserved. The ownership marker is removed only after payload cleanup succeeds, preserving recovery after failed deletion.
Focused tests cover environment isolation, normal interruption cleanup, ownership-marker validation, pre-allocation orphan recovery, and protection of active runtime directories.
Why
The packaged Antigravity runtime uses PyInstaller, which extracts files into
_MEI*directories. When these directories are created directly in the system temp folder and not removed, repeated launches can consume hundreds of gigabytes.Giving each runtime an owned temp directory allows T3 to clean up its files without touching unrelated temporary data.
Testing
vp test run src/provider/acp/AntigravityAcpSupport.test.ts— 33 tests passedvp run --filter t3 typecheckChecklist
Originally implemented with GPT-5.6 Sol in Codex Desktop.
Reviewed and updated with GPT-6 Astra via Codex in T3 Code.
Fixes #9650
Note
Add scoped Windows runtime temp directory lifecycle to
makeAntigravityAcpRuntimeTEMPandTMPin the spawn environment to point there; non-Windows launches are unchanged.reclaimOrphanedRuntimeTempDirectories, removing only marked dirs whose recorded owner PID is dead; invalid, mismatched, unowned, and live-owner dirs are left untouched.removeRuntimeTempDirectoryretries six times with exponential backoff, preserves the ownership marker while contents are locked, and logs a warning on final failure instead of propagating it.AntigravityAcpRuntimeInputinterface now requiresfilesystem,path, andplatformservices; callers likemakeAntigravityInstallationandAntigravityDriver.makeRuntimesupply these instead of passing spawn/process fields.TEMP/TMP(all case variants) and use the runtime-owned directory; cleanup failures are suppressed after logging.Macroscope summarized a2cab15.