Add LSP multiplexer to support multiple LSP toolsets#1970
Merged
dgageot merged 1 commit intodocker:mainfrom Mar 9, 2026
Merged
Add LSP multiplexer to support multiple LSP toolsets#1970dgageot merged 1 commit intodocker:mainfrom
dgageot merged 1 commit intodocker:mainfrom
Conversation
There was a problem hiding this comment.
Review Summary
Assessment: 🔴 CRITICAL
This PR adds LSP multiplexing functionality to combine multiple LSP toolsets. The core routing logic is sound, but there are 1 high-severity resource leak and 4 medium-severity issues that should be addressed before merging.
Critical Issues
HIGH: Resource leak in Start method - if initialization fails partway through, previously started LSP backends are left running.
Notable Issues
- Empty file arguments may route to unintended backends
- Type assertion failures are silently ignored in teamloader
- Broadcast operations abort on first error instead of aggregating results
- Constructor panics on invalid input (could return error instead)
Details
See inline comments below.
aa55338 to
9221d03
Compare
4870c9a to
47ff48c
Compare
Also simplifies the aqua registry from which lsp commands are downloaded from Fixes docker#1969 Assisted-By: cagent Signed-off-by: David Gageot <david.gageot@docker.com>
47ff48c to
dc49baf
Compare
aheritier
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When multiple LSP toolsets are configured (e.g.,
goplsfor Go andpyrightfor Python), each produces tools with identical names (lsp_hover,lsp_definition, etc.), causing LLM APIs to reject the request because tool names must be unique.Changes
pkg/tools/builtin/lsp_multiplexer.go— NewLSPMultiplexerthat combines multiple LSP backends into a single toolset:HandlesFile()ToolSet,Startable, andInstructableinterfacespkg/teamloader/teamloader.go— ModifiedgetToolsForAgentto detect multiple LSP toolsets and combine them into a single multiplexer. Per-toolset config (tool filters, instructions, toon, defer) is preserved.Tests — Comprehensive test coverage for routing, broadcasting, error handling, deduplication, and teamloader integration.
Fixes #1969