From 8d37eb29e8842ba2d7aefb048ebe7ee17030a705 Mon Sep 17 00:00:00 2001 From: kevocodes <62626446+kevocodes@users.noreply.github.com> Date: Thu, 23 Jul 2026 20:30:41 -0600 Subject: [PATCH] fix(installer): resolve Antigravity codegraph command out of fnm's ephemeral per-shell dir - resolveCodegraphCommand resolved `command -v codegraph`, which under fnm returns an ephemeral ~/.local/state/fnm_multishells//bin path that fnm removes when the installing shell exits, leaving a dangling MCP command - realpath the containing directory so the written command survives shell exit - preserve the `codegraph` basename so agents that validate the command by basename still match - fall back to the raw resolved path if realpath fails --- src/installer/targets/antigravity.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/installer/targets/antigravity.ts b/src/installer/targets/antigravity.ts index 1c128491a..4b18136b7 100644 --- a/src/installer/targets/antigravity.ts +++ b/src/installer/targets/antigravity.ts @@ -126,7 +126,19 @@ function resolveCodegraphCommand(): string { shell: '/bin/bash', windowsHide: true, }).trim(); - if (resolved && fs.existsSync(resolved)) return resolved; + if (resolved && fs.existsSync(resolved)) { + // fnm resolves `codegraph` inside an ephemeral per-shell symlink dir + // (~/.local/state/fnm_multishells//bin) that fnm removes when the + // installing shell exits, leaving a dangling command in the GUI app's + // MCP config. Canonicalize the containing directory so the path outlives + // the shell, while preserving the `codegraph` binary name (agents that + // validate the command by basename still match). + try { + return path.join(fs.realpathSync(path.dirname(resolved)), path.basename(resolved)); + } catch { + return resolved; + } + } } catch { /* fall through to bare name */ }