Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Custom Antigravity binary fails with wrapper scripts (.cmd/.bat) due to rigid localharness_external sibling check #12752

Closedcriticalstrike18(GitHub profile, opens in a new tab) opened this issue 3 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Create a custom wrapper script on Windows (e.g., agy-wrapper.cmd or a proxy executable) to wrap agy_acp_server.exe (e.g., to set custom environment variables or isolate temp directories).
  2. Point Antigravity's custom binary path (binaryPath) to this wrapper.
  3. Observe health check failure: The custom Antigravity executable or its localharness_external sibling is missing or not executable.
  4. If a placeholder localharness_external.cmd or copy is placed alongside it, the health check fails or hangs with: Unavailable · Antigravity could not complete its local health check.

Expected behavior

  1. T3 Code should allow custom binaries/wrappers without strictly requiring localharness_external.exe to reside in the exact same directory (e.g., fall back to the managed tool directory for localharness_external).
  2. Windows process spawning for ACP should reliably handle standard I/O pipes (stdin/stdout) when invoking .cmd or proxy executables.

Actual behavior

resolveSiblingExternalBinary checks path.join(path.dirname(binaryPath), "localharness_external" + ext). If missing, it immediately rejects the binary. If present, standard I/O pipe inheritance through Windows cmd.exe /c breaks the ACP JSON-RPC handshake.

Impact

Minor bug or occasional failure

Version or commit

0.0.42 (and main)

Environment

Windows 11 x64, T3 Code Desktop 0.0.42

Logs or stack traces

Not found: The custom Antigravity executable or its localharness_external sibling is missing or not executable.
# Or:
Unavailable: Antigravity could not complete its local health check.

Workaround

Must invoke the raw unpacked agy_acp_server.exe directly from its directory with localharness_external.exe present alongside it; cannot use wrappers or intermediate launchers.

Suggested Fix

  1. Make localharness_external resolution check the bundled/managed tool directory as a fallback when binaryPath is a custom path without its own localharness_external.
  2. Ensure stdio options and process spawning on Windows correctly pipe stdio when binaryPath has a .cmd or .bat extension.
  1. Triage

    Confirmed against shipping v0.0.42 and current main. This is a real Windows custom Antigravity binary limitation, not a desktop-only bug, not a missing managed install, and not the Linux aarch64 custom-path tickets.

    The filed copy matches the server:

    • Not found — The custom Antigravity executable or its localharness_external sibling is missing or not executable.
    • Unavailable — Antigravity could not complete its local health check.

    Area is apps/server, not apps/desktop. Desktop only hosts the server that resolves and spawns the ACP pair.

    What the code does

    1. Custom binaryPath is a same-directory pair. There is no managed-harness fallback.

    Resolution lives in apps/server/src/provider/AntigravityInstallation.ts (fromExternal — there is no resolveSiblingExternalBinary). For an override it:

    1. Requires the custom path to be a real file (agy-wrapper.cmd counts as a file on Windows; execute-bit is not checked).
    2. Requires localharness_external.exe in that same directory.
    3. Otherwise fails immediately with the sibling error above. It does not fall back to the managed tool dir or to PATH.

    That pairing is intentional. Docs say to extract agy_acp_server and localharness_external into the same directory, at the same version. Tests assert an override without a sibling fails and does not fall back (honors explicit paths and reports invalid overrides without falling back).

    A placeholder localharness_external.cmd still fails resolve: the Windows harness name is localharness_external.exe. A copied real .exe next to the wrapper does pass resolve.

    2. Passing resolve and then hanging is the Windows .cmd ACP spawn path.

    Spawn is buildAntigravityAcpSpawnInput → AcpSessionRuntime → resolveSpawnCommand (packages/shared/src/shell.ts). On Windows, .cmd / .bat is routed with shell: true (cmd.exe /c). ACP is JSON-RPC over stdin/stdout; that shell hop commonly breaks or stalls the handshake.

    On v0.0.42 the provider probe still spawned, so this showed up as the generic health-check line. On main (#12008) the probe is disk-only and does not spawn. Symptom shift:

    Setupv0.0.42main
    Wrapper, no localharness_external.exe siblingSibling resolve errorSame
    Wrapper + copied/real .exe siblingHealth-check hang / generic unavailableDisk probe can pass; session / sign-in still spawn and can hang

    3. Mixing a custom wrapper with the managed harness is not free.

    ANTIGRAVITY_HARNESS_PATH is injected from the resolved sibling. Falling back to the managed localharness_external when the wrapper is a different release can fail or hang worse than the current hard reject. Same-version pairing is the constraint, not just “file lives next door.”

    WorkWhy it does not close this
    #12477 / #12490Linux aarch64 custom/managed health check. Different host and cause.
    #12722Expands ~/ and directory custom paths so a CDN extract of the real pair resolves. Does not accept wrappers or a missing sibling.
    #10932agy CLI vs ACP runtime. This path already found a custom file.
    #12008Probe no longer spawns. Changes where the .cmd hang appears; does not fix resolve or spawn.

    Unique combination: Windows + custom wrapper / .cmd path + rigid sibling check (and ACP stdio through cmd.exe once a sibling exists).

    Workaround (supported)

    Point Binary path at the raw unpacked agy_acp_server.exe in the directory that also contains localharness_external.exe (managed install, or a same-version manual extract). Do not point it at a .cmd / .bat wrapper or at agy.

    Env / temp isolation the wrapper was meant to provide is already applied by T3 (prepareAntigravityProfile, per-process TMPDIR). Prefer that over an intermediate launcher.

    Suggested fix

    Keep the same-directory pair as the documented custom install.

    1. Bug: ACP spawn on Windows must keep stdin/stdout when binaryPath is .cmd / .bat (unwrap to a real .exe, or avoid cmd.exe /c for this protocol). Claude already unwraps npm .cmd shims for a similar reason.
    2. Enhancement (optional, careful): if the custom file exists but has no harness sibling, fall back to the same-version managed localharness_external only. Do not pair a wrapper with a different harness.

    No extra logs needed to place this. A redacted server.trace.ndjson around AntigravityInstallation.resolve / AcpSessionRuntime spawn would still help confirm the .cmd hang on a real session start.

  2. juliusmarminge added labelsbug

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

  5. I'd like to take this — I'll prepare a focused fix and regression coverage.

  6. juliusmarminge added labelsneeds more info

  7. juliusmarminge removed labelsneeds more info

  8. Retest on Windows 11 x64, current main (43879d9702), with the real Antigravity ACP runtime 1.3.0 (the managed pair, copied next to the wrappers) through T3's resolver, spawn-input builder and ACP runtime. No dev server and no sign-in; every run used a fresh empty profile.

    Spawn forminitializeFollow-up (session/new)
    direct agy_acp_server.exeok, 58–64 sAuthentication required in 25–29 ms
    .cmd wrapper (sets an env var, calls the exe with %*)ok, 65–66 ssame, 32–35 ms
    .bat wrapper (same content)ok, 61–68 ssame, 26–33 ms

    The wrapper's environment variable and arguments reached the runtime intact, and a normal session close left no runtime processes behind. So I could not reproduce the stdio break or hang through cmd.exe on current main. A compiled stand-in ACP process behind the same wrappers also passed 6 of 6 handshakes.

    One thing that may explain an earlier "hang": every start spent about a minute before answering initialize, because the runtime unpacks itself first (temp on an external SSD here). A health check or session start with a shorter timeout would look stuck.

  9. juliusmarminge closed this

Sign in to join this conversation.