#2122·serena

Windows: server exits 1 on host-requested shutdown and leaves stale process trees (breaks host MCP reload)

Author: CtrlCarlitosCreated Sep 29, 2026Updated Sep 30, 2026

Version

Serena 1.7.0 (installed via uv tool install serena-agent), Windows 11 Pro 24H2 (build 26100), PowerShell 7 / native Windows host (no WSL involved for this process tree).

What happens

When the hosting agent CLI (Antigravity CLI 1.2.13 in our case) requests a reload of its MCP config, it first asks the running serena instance to stop. On Windows that stop fails:

Failed to reload MCP config: failed to stop existing instances for reload: failed to stop mcp instance: serena: exit status 1

The first 1-2 reload attempts fail with this; a later attempt succeeds. Meanwhile stale serena process trees linger after the host session ends:

   Id ProcessName  StartTime
 8896 python      9/29/2026 10:17:12 AM
22540 python      9/29/2026 10:17:12 AM
23484 python      9/29/2026  9:58:47 AM
56552 python      9/29/2026  9:58:47 AM
12860 serena      9/29/2026  9:58:47 AM
13892 serena      9/29/2026 10:17:12 AM

Two complete stacks (the uv serena shim + its python children) from two different sessions, both still alive while no agent session was running.

Expected

  • The MCP server exits 0 (or at least terminates cleanly) when the host requests shutdown.
  • No orphaned shim/python children after the host session exits, so the next session's reload finds nothing to stop.

Notes

  • Spawn shape: serena start-mcp-server --context ide-assistant (from the host's mcp_servers entry, forceAllToolsEager: true).
  • Happy to test a fix or capture more diagnostics (stderr of the exiting process, --log-level trace of the shutdown path).