GitNexus/gitnexus/test
jwcrystal 22304cd4a4
fix(mcp): prevent orphan processes by handling stdin close/end and startup race condition (#2049)
* fix(mcp): prevent orphan processes by handling stdin close/end and startup race condition

Three gaps in stdin EOF handling:

1. Startup race: parent can die before `process.stdin.on("end", ...)` is
   registered, so the event is missed entirely.
2. Missing "close" event: when pipe is forcibly closed (parent SIGKILL),
   "close" fires without "end" on some platforms.
3. Transport layer did not propagate stdin termination to its onclose
   callback.

Fixes:
- Check readableEnded/destroyed in start() before registering listeners.
- Register stdin end+close listeners in CompatibleStdioServerTransport.
- Add _closed guard for idempotent close().
- Throw if start() is called after close().
- Add process.stdin.on("close") in server.ts alongside existing handlers.
- Add 5 regression tests.

* fix(mcp): register stdin shutdown before server connect
2026-06-05 08:36:28 +01:00
..
fixtures fix(csharp): qualified/alias constructor names, : base/: this initializers, generic type-arg strip (#2046) 2026-06-05 07:04:57 +01:00
helpers feat(ingestion): tree-sitter node-type/field validation gate + remove dead literals (#1937) 2026-05-31 10:29:41 +01:00
integration fix(csharp): qualified/alias constructor names, : base/: this initializers, generic type-arg strip (#2046) 2026-06-05 07:04:57 +01:00
unit fix(mcp): prevent orphan processes by handling stdin close/end and startup race condition (#2049) 2026-06-05 08:36:28 +01:00
utils fix(hooks): resolve gitnexus on PATH with a pure-Node scan, all-OS (#1938) (#1980) 2026-06-03 03:19:49 +01:00