mirror of
https://github.com/lukaszraczylo/filepuff-mcp.git
synced 2026-10-12 04:54:27 +00:00
A crashed language server stayed cached with ready==true: readLoop exited and drained in-flight calls but never cleared the running flag, and GetServer keyed reuse on ready alone. Every subsequent hover/definition/references then passed the running guard, wrote to a dead stdin, and blocked the full request timeout — permanently, since active use kept the server off the idle reaper. A single crash wedged that language at ~10s/call with no self-heal. - readLoop now flips running=false on exit, so Call fails fast instead of hanging. - GetServer treats ready && client.IsRunning() as the liveness condition; a stale entry is evicted (closed async — its process has already exited) and a fresh server is spawned in its place. - drainPending's send is now non-blocking, matching the dispatch path, so a duplicate-id race can't deadlock it under c.mu. Test (proven to fail without the fix): a client whose process exits is marked not-running and its next Call fails fast rather than blocking.