fix(lsp): suppress unhandled spawn error on LSP child process#99922
fix(lsp): suppress unhandled spawn error on LSP child process#99922cxbAsDev wants to merge 5 commits into
Conversation
spawnLspServerProcess returns a ChildProcess without an error handler. If the LSP server binary is missing (ENOENT), the async error event crashes the process. Add a noop error handler, consistent with the pattern used in the supervisor child adapter and MCP stdio transport. Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 10:21 AM ET / 14:21 UTC. Summary PR surface: Source +2, Tests +15. Total +17 across 2 files. Reproducibility: yes. Current main returns the spawned LSP child without an Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow spawn-boundary guard and regression test after maintainer review and green required checks; richer LSP ENOENT diagnostics can remain a separate follow-up. Do we have a high-confidence way to reproduce the issue? Yes. Current main returns the spawned LSP child without an Is this the best way to solve the issue? Yes. Attaching the guard inside AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 11eeba972f46. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +15. Total +17 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
What Problem This Solves
spawnLspServerProcess returns a bare ChildProcess without an error handler. Missing LSP binary (ENOENT) emits unhandled error event that crashes the gateway.
Why This Change Was Made
Add child.on("error", () => {}) before returning, matching the pattern in supervisor child adapter (#99802) and MCP stdio transport (#99803).
User Impact
Missing or unstartable LSP servers no longer crash the gateway. Existing LSP initialization failure path provides diagnostics.
Evidence
Live proof: spawnLspServerProcess with nonexistent binary, NO extra handlers. Process survives. Regression test: 4 passed.
Risk
Low. One-line noop handler. Same pattern merged in #99800, #99802, #99803.