hermes-agent/agent/lsp
JabberELF 18a9467fca fix(tui): prevent killpg suicide during MCP shutdown
Root cause: gateway spawns LSP servers (jdtls/pyright/yaml-ls) and
slash_worker without start_new_session=True, so they inherit the
gateway process group (= TUI parent PID). When mcp_tool
_snapshot_child_pids() races with these spawns during stdio MCP
server startup, non-MCP children leak into _stdio_pgids with the
TUI parent PGID. shutdown_mcp_servers() then killpg(tui_parent_pid,
SIGTERM), killing the TUI itself.

Evidence: tui_gateway_crash.log shows recurring SIGTERM stacks:
  shutdown_mcp_servers -> _kill_orphaned_mcp_children ->
  _send_signal -> killpg(pgid, sig) -> SIGTERM received

Fix (3 layers):
1. agent/lsp/client.py: add start_new_session=True to LSP server
   spawn so each LSP server gets its own process group/session.
2. tui_gateway/server.py: same fix for slash_worker spawn, the
   symmetric root-cause patch so no gateway direct child shares
   the TUI parent pgid.
3. tools/mcp_tool.py: add _filter_mcp_children() defense-in-depth
   that drops non-MCP children (slash_worker, jdtls/eclipse LSP)
   from the PID delta before they can poison _stdio_pgids.
2026-07-01 04:54:46 -07:00
..
__init__.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00
cli.py fix(lsp): detect Windows wrapper binaries in installer probes 2026-05-30 02:08:36 -07:00
client.py fix(tui): prevent killpg suicide during MCP shutdown 2026-07-01 04:54:46 -07:00
eventlog.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00
install.py feat(lsp): add PowerShellEditorServices language server (#55930) 2026-06-30 16:22:18 -07:00
manager.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
protocol.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00
range_shift.py fix(lsp): shift baseline diagnostics into post-edit coordinates (#25978) 2026-05-14 15:56:07 -07:00
reporter.py fix(security): sanitize LSP diagnostic fields to prevent indirect prompt injection 2026-06-30 03:48:41 -07:00
servers.py feat(lsp): add PowerShellEditorServices language server (#55930) 2026-06-30 16:22:18 -07:00
workspace.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00