LSP server manager initializes before plugins register their servers (race condition)
Description
The LSP server manager completes initialization before the pyright-lsp plugin has a chance to register its LSP server, resulting in No LSP server available for file type: .py errors even though everything is correctly configured.
Environment
- OS: Linux (WSL2) 4.4.0-22621-Microsoft
- Pyright: v1.1.408 installed globally via npm (
/usr/bin/pyright-langserver) - Plugin:
pyright-lsp@claude-plugins-officialv1.0.0
Configuration
~/.claude/settings.json:
{
"env": {
"ENABLE_LSP_TOOL": "1"
},
"enabledPlugins": {
"pyright-lsp@claude-plugins-official": true
}
}
plugin.json (cached at ~/.claude/plugins/cache/claude-plugins-official/pyright-lsp/1.0.0/):
{
"name": "pyright-lsp",
"description": "Python language server (Pyright) for type checking and code intelligence",
"version": "1.0.0",
"lspServers": {
"pyright": {
"command": "pyright-langserver",
"args": ["--stdio"],
"extensionToLanguage": {
".py": "python",
".pyi": "python"
}
}
}
}
Steps to Reproduce
- Configure pyright-lsp plugin as shown above
- Ensure
pyright-langserveris installed and on PATH - Start a Claude Code session
- Use the LSP tool (e.g.,
documentSymbolon a.pyfile)
Expected Behavior
The LSP tool should find the pyright server and return document symbols.
Actual Behavior
Returns: No LSP server available for file type: .py
Debug Log Evidence
The debug log (~/.claude/debug/latest) shows a timing gap — the LSP manager finishes init before the plugin loads:
2026-03-06T09:50:22.783Z [DEBUG] LSP server manager initialized successfully
2026-03-06T09:50:22.783Z [DEBUG] LSP notification handlers registered successfully for all 0 server(s)
2026-03-06T09:50:22.792Z [DEBUG] Loading plugin pyright-lsp from source: "./plugins/pyright-lsp"
2026-03-06T09:50:22.793Z [DEBUG] Plugin pyright-lsp@claude-plugins-official version 1.0.0 already cached
The manager registers 0 server(s) at 09:50:22.783Z, and the plugin only begins loading at 09:50:22.792Z (9ms later). By the time the plugin is loaded and its lspServers config is available, the manager has already completed initialization and is no longer looking for new servers to register.
When the LSP tool is actually invoked later, it finds no registered server for .py files:
2026-03-06T09:50:34.005Z [DEBUG] No LSP server available for file type .py for operation documentSymbol on file weight_exp/stability_utils/esm_utils.py
Root Cause Hypothesis
The LSP server manager initialization and plugin loading are independent async operations without proper synchronization. The manager should either:
- Wait for all enabled plugins to finish loading before finalizing server registration, or
- Support late registration of LSP servers from plugins that load after the manager initializes
🤖 Generated with Claude Code
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗