-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(lsp): cleanup orphaned LSP servers on session.deleted #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lsp): cleanup orphaned LSP servers on session.deleted #676
Conversation
When parallel background agent tasks complete, their LSP servers (for repos cloned to /tmp/) remain running until a 5-minute idle timeout. This causes memory accumulation with heavy parallel Sisyphus usage, potentially leading to OOM crashes. This change adds cleanupTempDirectoryClients() to LSPServerManager (matching the pattern used by SkillMcpManager.disconnectSession()) and calls it on session.deleted events. The cleanup targets idle LSP clients (refCount=0) for temporary directories (/tmp/, /var/folders/) where agent tasks clone repos.
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
|
recheck |
|
I have read the CLA Document and I hereby sign the CLA |
…yu#676) * fix(lsp): cleanup orphaned LSP servers on session.deleted When parallel background agent tasks complete, their LSP servers (for repos cloned to /tmp/) remain running until a 5-minute idle timeout. This causes memory accumulation with heavy parallel Sisyphus usage, potentially leading to OOM crashes. This change adds cleanupTempDirectoryClients() to LSPServerManager (matching the pattern used by SkillMcpManager.disconnectSession()) and calls it on session.deleted events. The cleanup targets idle LSP clients (refCount=0) for temporary directories (/tmp/, /var/folders/) where agent tasks clone repos. * chore: retrigger CI checks
* fix(lsp): cleanup orphaned LSP servers on session.deleted When parallel background agent tasks complete, their LSP servers (for repos cloned to /tmp/) remain running until a 5-minute idle timeout. This causes memory accumulation with heavy parallel Sisyphus usage, potentially leading to OOM crashes. This change adds cleanupTempDirectoryClients() to LSPServerManager (matching the pattern used by SkillMcpManager.disconnectSession()) and calls it on session.deleted events. The cleanup targets idle LSP clients (refCount=0) for temporary directories (/tmp/, /var/folders/) where agent tasks clone repos. * chore: retrigger CI checks
Problem
When parallel background agent tasks complete, their LSP servers (for repos cloned to
/tmp/) remain running until a 5-minute idle timeout. This causes memory accumulation with heavy parallel Sisyphus usage, potentially leading to OOM crashes.Root cause:
SkillMcpManagerhasdisconnectSession()called onsession.deletedevents, butLSPServerManagerhas no equivalent cleanup mechanism.Solution
Added
cleanupTempDirectoryClients()toLSPServerManager(matching the pattern used bySkillMcpManager.disconnectSession()) and call it onsession.deletedevents.The cleanup targets idle LSP clients (
refCount=0) for temporary directories (/tmp/,/var/folders/) where agent tasks clone repos.Changes
src/tools/lsp/client.ts: AddedcleanupTempDirectoryClients()methodsrc/tools/index.ts: ExportedlspManagersrc/index.ts: Call cleanup onsession.deletedTesting
SkillMcpManager.disconnectSession)Related Issues
Summary by cubic
Clean up idle LSP servers in temp directories when a session is deleted to prevent memory buildup from background agent tasks. Reduces lingering tsserver processes and lowers OOM risk during heavy parallel runs.
Written for commit a8d6cf6. Summary will update on new commits.
I have read the CLA Document and I hereby sign the CLA