fix(server): Windows .cmd launchers work as the Antigravity binary path #24683
main fromrefs/pull/24683/head·merged by juliusmarminge View on GitHubProblem#
On Windows, an Antigravity Binary path that points at a .cmd or .bat launcher for agy_acp_server.exe fails with "The custom Antigravity executable is missing or not executable, or it needs a localharness_external sibling", because the resolver looks for the helper next to the script instead of next to the executable. A launcher named agy.cmd passes, but it starts as the agy CLI (agy.cmd acp) and loses the helper, the managed version and the removal guard.
Change#
When a .cmd or .bat launcher only sets things up and runs exactly one agy_acp_server.exe by full or %~dp0-relative path, the resolver takes the helper from that executable's directory. T3 Code still spawns the script. An executable inside the managed runtime carries the managed version and keeps removal blocked. Anything less certain keeps today's same-directory rule (details below).
Scope#
A bug fix for an error: a valid launcher path fails with an error. Fixes #12752 (triaged bug, labeled accepted); it keeps the triage's same-version pairing.
Verification#
Re-checked 2026-11-17 against main b387e3a179: 0bd95e3b5c merges cleanly, its resolver test passes on the merge (45 tests) and fails with that main's resolver (1 of 45).
Setup. Windows 11 VM, T3 from source, fresh data per commit, Browser panel, light, 1280x1300; Google's v1.4.5 ACP pair, plain and as a hand-laid managed release; no sign-in. An AI agent (Claude Opus 5.5 in T3 Code) ran every check and capture.
Steps. Settings → Providers → Antigravity → wrapper path in Binary path → Refresh provider status.
| Before 0bc993ac09 | After 0bd95e3b5c |
|---|---|
|
agy-wrapper.cmd: Not found, with the localharness_external error |
agy-wrapper.cmd: Not authenticated |
|
agy-managed.cmd: Not found, with the localharness_external error |
agy-managed.cmd: v1.4.5, Not authenticated |
Links. Every capture, the process listings and the steps.
Not shown
- The Windows desktop app; sign-in, a completed turn and the removal guard through a launcher; launchers that
callanother script; whether a runtime started throughcmd.exeoutlives a killed server. agy-qset.cmd(a quotedsetline) on0bd95e3b5c(the resolver test covers it); a real older managed install.
Launcher rules and the checks
On Linux. On 0bd95e3b5c merged locally with main b387e3a179 (never pushed), Node 26.13.1, in apps/server, with that main's resolver, then as is:
$ git show b387e3a179:apps/server/src/provider/AntigravityInstallation.ts > src/provider/AntigravityInstallation.ts # main's production file, this PR's test
$ vp env exec --node 26.13.1 -- vp test run src/provider/AntigravityInstallation.test.ts
FAIL src/provider/AntigravityInstallation.test.ts > Antigravity installation > pairs a Windows launcher script with the helper beside the executable it runs
Tests 1 failed | 44 passed (45)
$ git checkout -- src/provider/AntigravityInstallation.ts
$ vp env exec --node 26.13.1 -- vp test run src/provider/AntigravityInstallation.test.ts
Tests 45 passed (45)
Launcher rules. The script may contain only setup lines (set, echo, comments, exit) and must run exactly one agy_acp_server.exe from the start of a line. Anything less certain keeps today's same-directory rule: any other line (if, call, a %VAR% launch), a launch line chained with &, && or ||, two different executables, an unexpanded %VAR% in the path, a bare name resolved through PATH, a path whose drive comes from the working directory (\dir\agy_acp_server.exe), or a path that only appears in a comment or echo. The pairing Julius described in the triage still holds: the helper always comes from the directory of the executable that actually runs. The resolver never borrows a helper from another release. Because this check runs before the #32503 name check, an agy.cmd that runs agy_acp_server.exe keeps its helper, while npm agy.cmd shims and scripts that run agy.exe still take the CLI route. The Antigravity provider guide gets one sentence on launcher scripts.
The Windows launchers. agy-wrapper.cmd and .bat set AGY_LAUNCHER_TEMP and run the plain-folder agy_acp_server.exe by full path; agy-managed.cmd and .bat run the managed one. Each status capture was taken twice per side with no differing pixels. Controls on 0bc993ac09: the plain-folder executable typed directly reaches Not authenticated, and the managed executable shows v1.4.5, so only the wrapper fails on main. The .bat copies show the same. After, T3 spawns the script itself, and the ACP server under it gets the script's variable and the localharness_external.exe beside the launched executable, not beside the script.
Spawning. Spawning is unchanged: a retest on main 43879d9702 by SouthCarpet started ACP through .cmd and .bat launchers with stdio intact.
The merges. e0c2115187 merged main 86ff9d073c into this branch: one conflict, with #21249 (315b06c5ec, "managed Antigravity and Codex installs can update past their pin") in AntigravityInstallation.ts, where both sides added constants after RELEASE_RECORD; both are kept, unchanged. 0bd95e3b5c merges main 0bc993ac09 into e0c2115187. #21249 changes the managed install and its update offers, not how a custom Binary path is checked; #35171 (9771c5fd2d) expands a ~/ Binary path before the launcher step.
Checks. On 0bd95e3b5c every CI check is green.
Prior PRs#
#12878 by cestercian fixed the same issue and was closed for a missing model note and merge conflicts, not on its merits. It spawned the unwrapped .exe, dropping the launcher's own setup, and parsed scripts in more depth; this PR keeps spawning the script.
Generated with Claude Opus 5.5 in T3 Code Nightly




Evidence#
All captures: Windows Server 2025 Datacenter (build 26100), headless Chromium, 1600×1400, dark theme, separate fresh homes, identical provider settings, no credentials and no threads. The official ACP 1.4.5 executable/helper pair and archive SHA-256 were verified. The environment label is normalized to “Windows proof” for privacy.
Base rejects both launchers with the localharness_external sibling error; head recognizes both. Head retains v1.4.5 through agy.cmd and blocks removal of its referenced release; base loses the version and permits removal. Successfully resolved paths show “Installed · Sign-in not checked” in these status-only runs. The direct executable control screenshots are byte-for-byte identical. Stills passed a 500 ms identical-frame check and were visually reviewed; the new recordings show no freeze toast.
Drivers and fixtures: driver.cjs, removal-driver.cjs, runtime-fixture.ps1, final-setup.ps1, run-apps.ps1.
Environment and commit provenance; base observations, head observations, base removal observations, head removal observations.
Not shown: