# \[Windows v2.38.0 / CL 1035709027\] Repeated language\_server.exe crashes (exit code 2), SetCrashOutput/log-truncation blind spot, and 5 Windows/CLI issues

**URL:** <https://discuss.google.dev/t/windows-v2-38-0-cl-1035709027-repeated-language-server-exe-crashes-exit-code-2-setcrashoutput-log-truncation-blind-spot-and-5-windows-cli-issues/420146>\
**Category:** Agents\
**Tags:** tools, mcp, antigravity\
**Created:** [December 4, 2026, 7:10pm UTC](https://discuss.google.dev/t/windows-v2-38-0-cl-1035709027-repeated-language-server-exe-crashes-exit-code-2-setcrashoutput-log-truncation-blind-spot-and-5-windows-cli-issues/420146 "2026-12-04T19:10:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joao\_Petreche](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/joao_petreche/32/292137_2.png) [@Joao\_Petreche](https://discuss.google.dev/u/Joao_Petreche)\
**Post date:** [December 4, 2026, 7:10pm UTC](https://discuss.google.dev/t/windows-v2-38-0-cl-1035709027-repeated-language-server-exe-crashes-exit-code-2-setcrashoutput-log-truncation-blind-spot-and-5-windows-cli-issues/420146/1 "2026-12-04T19:10:40Z")

</div>

### Summary

Sharing a detailed Windows diagnostic report (already submitted via in-app **Give Feedback → Bug Report** with server logs attached) in case other Windows 26H2 / `v2.38.0` users are seeing the same behavior or the Antigravity Windows engineering team wants to cross-reference.

On Windows Hub (`v2.37.0` and `v2.38.0`), `language_server.exe` repeatedly crashes with `exited with code 2`, compounded by a crash-diagnostic blind spot between Go’s `runtime/debug.SetCrashOutput` and Electron’s `stderr`-only crash extractor + log truncation on auto-restart, alongside 5 additional Windows/CLI issues visible in the logs.

### Environment

- **OS:** Windows 10/11 Pro (26H2, Build `26300.10075`, AMD64)
- **Hardware:** 12 logical CPUs, 33.46 GB RAM (9.17 GB physical RAM free / 13.70 GB commit free at crash time — not host OOM)
- **Antigravity Desktop (Hub):** `v2.38.0`
- **Language Server Stamp (`language_server.exe --stamp`):** `CL 1035709027` (baseline `1034952883`, built `2026-12-03 19:02:31 -0300`)
- **Antigravity CLI (`agy --version`):** `1.5.24`

### Observed Crash Frequency & Cross-Conversation Impact

- **`%APPDATA%\Antigravity\logs\main.log`** records **138** occurrences of `Language server crashed: exited with code 2` (distinct from intentional self-restart `LS_RESTART_EXIT_CODE = 42`), including **18 crashes in ~17 hours** :
  - 8 crashes on `v2.37.0` overnight
  - 10 crashes on `v2.38.0` in ~4.5 hours

- Because `--subclient_type hub` runs a single shared `language_server.exe` (`GOMAXPROCS=4`), panics triggered during concurrent activity in one heavy conversation/subagent (e.g., two active multi-MB trajectories of ~2,100 and ~3,750 steps + concurrent subagents + PDF viewer tab + MCP calls) terminate the shared server and stop all subagents/background tasks across idle conversations (`Resuming 2 conversation(s) interrupted by server restart`, `server.go:5650`).

* * *

### Detailed Findings & Proposed Fixes (Windows)

#### 1. [Critical] Double Crash-Diagnostic Blind Spot (`SetCrashOutput` vs. Electron `stderr` Extractor + Log Truncation)

- **Observed:** Across all 138 `exited with code 2` crashes in `main.log`, `monitorLsCrashInternal` never logs `--- Crash Stack Trace ---`.
- **Root Cause:**
  1. `language_server.exe` redirects Go runtime crash output via `runtime/debug.SetCrashOutput` to `%USERPROFILE%\.gemini\antigravity\crashes\crash_<PID>_<uuid>.log`. Because the panic/fatal trace goes to that file instead of `stderr`, Electron’s `extractCrashStackTrace(fullStderr)` (matching `CRASH_TRIGGER_PHRASES = ['panic:', 'fatal error:', ...]`) always returns `undefined`.
  2. Two seconds later (`RESTART_COOLDOWN_MS = 2000`), `startLanguageServer` opens `language_server.log` with `fs.createWriteStream(getLsLogPath(), { flags: 'w' })`, immediately truncating the dead PID’s log. Meanwhile, the newly spawned PID consumes/removes the previous `crash_<old_pid>_*.log` on startup (and may miss uploading if telemetry hits `startup_wait_timeout` / `Telemetry reporter not initialized, cannot upload pending crashes`).

- **Proposed Fix:**
  1. In `proc.on('exit')` (Electron main process), before respawning, read any non-empty `crash_<exitedPid>_*.log` in `.gemini/antigravity/crashes/` as a fallback when `extractCrashStackTrace(fullStderr)` is empty, log top frames into `main.log`, and retain the last 3 rotated crash files locally for `diagnostics.json.gz`.
  2. Rotate `language_server.log` → `language_server.prev.log` before opening `{ flags: 'w' }`.

#### 2. [High] Windows NTFS `ERROR_ACCESS_DENIED` Loop on Marketplace Plugin Auto-Upgrade (`rpcs_marketplace.go:1352`)

- **Observed:** Every server startup attempts to upgrade an installed marketplace plugin (e.g., `chemistry` `1.0.0` → `1.0.3`) and fails:  
`failed to move existing plugin %USERPROFILE%\.gemini\config\plugins\chemistry aside: rename .../plugins/chemistry .../cache/marketplaces/.../.chemistry.old.<rand>.tmp: Access is denied.` (`errorreport.go:282`)
- **Root Cause:** Unlike POSIX `rename()`, Windows `MoveFileExW` on a directory fails with `ERROR_ACCESS_DENIED` if any open handle exists inside the directory (internal skill/plugin watchers, embedded `rg.exe`, sidecars, or Windows Defender) or across mount/reparse boundaries.
- **Proposed Fix:** Close/pause plugin watchers & sidecars for the target plugin before swapping, stage inside the same parent directory with short exponential-backoff retries for transient Windows AV/indexer locks, and fall back to a pre-watcher “pending plugin swap” step on next startup.

#### 3. [High] Startup Storm of 564+ Orphan Trajectories + 10s `startup_wait_timeout` + Hardcoded `GOMAXPROCS=4`

- **Observed:** On every restart:
  - `extract_searchable_content.go:54` logs **564** consecutive warnings: `conversationsearch: loading trajectory <id> for index extraction: trajectory <id> not found in any store: file does not exist`.
  - `reconcile_summaries.go:78` fails on side-chat IDs (`conversation <id> not found`).
  - `server.go:5540`: `State refresh took 10000ms` → `auth_status_telemetry.go:81`: `[auth-status] ms=10001 reason=startup_wait_timeout rpc=get_auth_status valid=false`.
  - `server.go:1295`: `Setting GOMAXPROCS to 4` on a 12-logical-CPU Hub machine running concurrent multi-MB conversations + subagents + multi-root `ripgrep`.

- **Proposed Fix:** Prune/tombstone `os.ErrNotExist` trajectory IDs from `conversationsearch` and `summary store` during reconciliation; scale `GOMAXPROCS` dynamically in Hub mode (e.g., `min(max(4, runtime.NumCPU()/2), 8)`); add `recover()` middleware on RPC/SSE stream handlers and background indexers so a panic in one conversation/worker cannot crash the shared Hub process.

#### 4. [Medium] MCP Plugin Tool Double-Prefixing Exceeding 64-Char Limit (`mcp_client_session_instance.go:231`)

- **Observed:** When a plugin ID and its MCP server name are identical (e.g., `my-custom-workbench`), `language_server` constructs `mcp_<plugin>_<server>_<tool>` (easily exceeding 64 chars), failing `^[a-zA-Z0-9_-]{1,64}$` and silently dropping valid MCP tools.
- **Proposed Fix:** Deduplicate `<plugin>_<server>` when identical (`mcp_<plugin>_<tool>`), and deterministically truncate + append a short hash suffix if still \> 64 chars.

#### 5. [Low] Hardcoded Linux Path on Windows (`defaults.go:713`) & Noisy HTML 404 on `prompts/list` (`rpcs_cascade.go:1443`)

- **Observed:** `defaults.go:713` logs `failed to get cs path: cs path /usr/bin/cs invalid` on Windows; `rpcs_cascade.go:1443` logs full HTML 404 pages when calling `prompts/list` against Streamable HTTP MCP endpoints that don’t advertise prompts.
- **Proposed Fix:** Skip `/usr/bin/cs` probe on `GOOS == "windows"`; check negotiated MCP `capabilities.prompts` before calling `prompts/list`; truncate HTML bodies in HTTP error logs.

#### 6. [High] `agy` CLI `1.5.24` Ignores `"disabled": true` in `~/.gemini/config/mcp_config.json`

- **Observed:** In non-interactive mode (`agy -p ... --print-timeout 120s`), `agy` `1.5.24` still initializes MCP servers marked `"disabled": true` in `~/.gemini/config/mcp_config.json`. If a disabled server requires interactive OAuth or stalls, `agy -p` hangs until `--print-timeout` (removing the entry from JSON immediately resolves the hang).
- **Proposed Fix:** Honor `"disabled": true` in `agy` CLI (matching Desktop App behavior) and enforce a short non-blocking per-server MCP init timeout in `-p` print mode.
