Skip to content

fix(daemon): leave LSP instances free after disconnect - #82

Merged
yaacovcorcos merged 1 commit into
mainfrom
claude/lsp-acquire-disconnect-20261123
Nov 23, 2026
Merged

yaacovcorcos merged 1 commit into
mainfrom
claude/lsp-acquire-disconnect-20261123

Conversation

@yaacovcorcos

Copy link
Copy Markdown
Contributor

What

A client that disconnects while the daemon resolves its working directory leaves the first free language-server instance available for the next client. The daemon tracks the pending request before resolving the directory and checks the connection immediately before reserving an instance.

Why

A reservation created after disconnect cleanup could hold an otherwise free key for 30 seconds and cause the next client to start a duplicate server. The fix is also open upstream. At the next alignment, retire this contract if Oh My Pi merges it or replace it with their fix. Oh My Pi #20277

Testing

The regression test disconnects a client while its acquire is resolving the working directory. The old code resolves that acquire. The fixed code rejects it, and the next client gets instance zero.

The 15 focused daemon tests, bun check, and the divergence check passed. The full local TypeScript run passed 238 of 247 test groups. Failures included macOS temporary-path alias mismatches and timeouts. The language-server test that timed out passed when rerun in a temporary directory without a path alias.

Platforms

macOS ran the local checks above. Linux and Windows builds and isolation checks run in PR CI.

Review

Codex high reviewed 099b7cb64b40e6bb826a07451136c0b7c5b7e6c8 and found no correctness blockers.


  • bun check passes
  • Tested locally
  • CHANGELOG updated with the required attribution (upstream PR carries the credited entry, and the Scient Agent contract is documented in SCIENT.md)

Scient-Divergence: SA-LSP-ACQUIRE-DISCONNECT
@yaacovcorcos
yaacovcorcos merged commit f43afd1 into main Nov 23, 2026
22 checks passed
@yaacovcorcos
yaacovcorcos deleted the claude/lsp-acquire-disconnect-20261123 branch November 23, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant