GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(antigravity): clean Windows runtime temp files by ariszz · Pull Request #9626 · pingdotgg/t3code

Conversation

@ariszz

@ariszz ariszz commented Sep 4, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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 passed
  • vp run --filter t3 typecheck
  • Targeted lint and formatting checks for all six changed files; rerun for the two updated files
  • Earlier revision: manually launched and stopped the Windows desktop app twice; confirmed each launch's runtime temp directory was removed after shutdown
  • New regression test verifies marker preservation after exhausted cleanup retries and recovery by a later sweep; failed before the fix and passes afterward
  • Additional Windows test: all nine runtime folders from three refreshes were removed. Dev-runner shutdown left one marked folder; restart automatically reclaimed it.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes
  • No animation or interaction changes

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 makeAntigravityAcpRuntime

  • On Windows, each Antigravity ACP runtime now allocates a marked, process-specific temp directory and rewrites both TEMP and TMP in the spawn environment to point there; non-Windows launches are unchanged.
  • Startup reclaims stale directories via reclaimOrphanedRuntimeTempDirectories, removing only marked dirs whose recorded owner PID is dead; invalid, mismatched, unowned, and live-owner dirs are left untouched.
  • Scope cleanup via removeRuntimeTempDirectory retries six times with exponential backoff, preserves the ownership marker while contents are locked, and logs a warning on final failure instead of propagating it.
  • The AntigravityAcpRuntimeInput interface now requires filesystem, path, and platform services; callers like makeAntigravityInstallation and AntigravityDriver.makeRuntime supply these instead of passing spawn/process fields.
  • Behavioral Change: Windows ACP spawn inputs now ignore any caller-provided TEMP/TMP (all case variants) and use the runtime-owned directory; cleanup failures are suppressed after logging.

Macroscope summarized a2cab15.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

andybergon and gabew100 reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@ariszz
fix(antigravity): clean Windows runtime temp files
d8affb6
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 4, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Sep 4, 2026
View reviewed changes
Comment thread apps/server/src/provider/acp/AntigravityAcpSupport.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Sep 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ariszz
fix(antigravity): verify runtime temp ownership
2c0f8eb
macroscopeapp[bot]
macroscopeapp Bot reviewed Sep 4, 2026
View reviewed changes
Comment thread apps/server/src/provider/acp/AntigravityAcpSupport.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ariszz
fix(antigravity): reclaim temp before allocation
7d40ee2
@Kevin-nav Kevin-nav mentioned this pull request Sep 4, 2026
[Bug]: Antigravity health checks leave large _MEI folders in Windows temp #9650
Closed
2 tasks done
@ariszz
fix(antigravity): preserve temp marker after cleanup failure
a2cab15
@andybergon

andybergon commented Sep 7, 2026

Copy link
Copy Markdown

We hit the matching Windows Temp accumulation on Nightly 0.0.40-nightly.20260907.1346 with managed Antigravity ACP 1.1.1: 204 _MEI* folders, approximately 202 GiB total in Temp, and zero free space on C:.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge mentioned this pull request Sep 9, 2026
agy_acp_server leaves orphaned PyInstaller _MEI* temp folders that accumulate and fill the disk #10862
Closed
@dancingmadkefka

dancingmadkefka commented Sep 9, 2026

Copy link
Copy Markdown

encountered this also. Disabled antigravity

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mchicao

Mchicao commented Sep 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

+1 — hit this in the wild, with numbers.

Windows 11, t3code with the Antigravity agent enabled. Found 145 orphaned _MEI* folders ≈ 108 GB in %TEMP%, each ~0.86 GB (payload: a 550 MB localharness binary + Google client libs + python310.dll). It had the system disk at 98%.

Data points that may help:

  • Orphans only appear during working hours, several per hour — consistent with the health-check cadence rather than actual agent usage.
  • Timeline correlates with an Antigravity update (language_server.exe updated Sep 2 ~21:00 local; the first orphans appear Sep 3).

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 _MEI* folders. So the harness cleans up after itself when it exits normally; the leak only shows up where the process gets force-terminated (i.e. where t3code's health checks run). That matches the theory behind this PR.

Temporary mitigation we're running locally: a small janitor that deletes %TEMP%\_MEI* older than 30 min every couple of minutes (in-use dirs survive via file locks). Happy to test the isolated, owner-marked temp-dir approach from this PR once it lands — thanks for working on it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rolandorojas

rolandorojas commented Sep 9, 2026

Copy link
Copy Markdown

Codex here, posting for this account’s owner. We also see this on nightly 0.0.41-nightly.20260909.1439: 237 Antigravity _MEI* folders totaling 261.90 GiB, with new folders about every five minutes. We have not tested this fix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JosephDemarest

JosephDemarest commented Sep 11, 2026

Copy link
Copy Markdown

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 agy_acp_server_1.1.1. Runtime installed 14:43 local; first orphan appeared the same minute. By evening: 118 _MEI* directories, ~137 GB, C: down to 50 MB free. After cleanup, 11 new directories (~13 GB) in 8 minutes of ordinary use.

Why containing the extraction looks right, rather than trying to stop the process cleanly. I ran the bundled agy_acp_server.exe directly, outside T3:

  • extraction is ~1.2 GB and lands in about 3 s;
  • closing the child's stdin does not make it exit (still alive after 20 s), so there is no EOF-based graceful path;
  • TerminateProcess (exit -1) leaves the entire extraction behind.

So every caller ends up force-killing it, and cleanup has to be owned by the caller, which is what this PR does. Redirecting TEMP/TMP per runtime also covers the probe path through makeAntigravityInstallation, the high-frequency trigger in #9650.

Question on reclaimOrphanedRuntimeTempDirectories. The sweep skips any directory whose encoded owner PID is still alive, and the owner is the long-lived T3 server process. If removeRuntimeTempDirectory exhausts its six attempts (~3.1 s total) the marker is deliberately preserved, but that residue can't then be reclaimed by the same server, because its own PID is alive. It waits for a T3 restart plus the next Antigravity launch. Would it be worth also sweeping own-PID directories that no live runtime scope currently holds, or sweeping once unconditionally at server startup? At the orphan rates reported here, a locked payload that survives until restart could still accumulate.

Haven't built this branch: this is confirmation plus a code read, not validation of the fix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MiloAgudelo

MiloAgudelo commented Sep 13, 2026

Copy link
Copy Markdown

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 _MEI* folders / ~167 GB in %LOCALAPPDATA%\Temp. That alone took the volume to 90% full. Creation times line up with checkAntigravityProvider (median 329.5 s between folders; latest _MEI at 19:58:31 vs cache checkedAt 19:59:03).

A scoped TEMP/TMP directory that T3 actually deletes after taskkill is the right fix. Until this lands, the default probe will keep dumping ~1.16 GB on every tick and eat the system drive.

Thanks for taking this — please merge it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@VitaCodez VitaCodez mentioned this pull request Sep 15, 2026
fix(antigravity): avoid spawning process on probe and isolate temp di… #11657
Closed
@t3dotgg t3dotgg mentioned this pull request Sep 16, 2026
fix(antigravity): stop health checks from filling the disk with _MEI folders #12008
Merged
t3dotgg added a commit that referenced this pull request Sep 16, 2026
@t3dotgg @VitaCodez @claude
fix(antigravity): stop health checks from filling the disk with _MEI …
8c18b5b
…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 <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
@juliusmarminge

juliusmarminge commented Sep 16, 2026

Copy link
Copy Markdown
Member

Superseded by #12008, which merged and closed #9650. Closing this PR as leftover hygiene.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge

juliusmarminge commented Sep 16, 2026

Copy link
Copy Markdown
Member

Superseded by #12008, which shipped the per-process owned temp directory approach credited from this PR (without system-temp sweeps). Closing this as superseded.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Antigravity health checks leave large _MEI folders in Windows temp

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@ariszz @andybergon @dancingmadkefka @Mchicao @rolandorojas @JosephDemarest @MiloAgudelo @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.