LSP plugin servers not registered due to initialization race condition
Bug Description
LSP plugins (e.g., pyright-lsp) are loaded but their LSP servers are never registered because the LSP server manager initializes before plugins are loaded.
Environment
- OS: Linux (WSL2) -
Linux 6.6.87.2-microsoft-standard-WSL2 - Node.js: v20.19.3
- Plugin:
pyright-lsp@claude-plugins-officialv1.0.0 - Pyright: 1.1.407 (installed via
npm install -g pyright)
Steps to Reproduce
- Install the pyright-lsp plugin:
/plugin install pyright-lsp - Install pyright:
npm install -g pyright - Verify pyright-langserver is in PATH:
which pyright-langserver✓ - Verify plugin is enabled in
~/.claude/settings.json:
``json``
{
"enabledPlugins": {
"pyright-lsp@claude-plugins-official": true
}
}
- Restart Claude Code
- Try any LSP operation on a Python file
Expected Behavior
LSP operations (hover, goToDefinition, findReferences, etc.) should work on Python files.
Actual Behavior
All LSP operations return: No LSP server available for file type: .py
Root Cause (from debug logs)
The debug log at ~/.claude/debug/latest shows a race condition:
2025-12-29T20:29:36.118Z [DEBUG] LSP server manager initialized successfully
2025-12-29T20:29:36.118Z [DEBUG] LSP notification handlers registered successfully for all 0 server(s)
2025-12-29T20:29:36.123Z [DEBUG] Loading plugin pyright-lsp from source: "./plugins/pyright-lsp"
2025-12-29T20:29:36.124Z [DEBUG] Using provided version for pyright-lsp@claude-plugins-official: 1.0.0
The LSP server manager initializes at .118Z with 0 servers, then the pyright-lsp plugin loads at .123Z (5ms later). The plugin's lspServers configuration from marketplace.json is never registered with the already-initialized LSP manager.
Plugin Configuration (from marketplace.json)
The plugin is correctly defined with LSP server config:
{
"name": "pyright-lsp",
"lspServers": {
"pyright": {
"command": "pyright-langserver",
"args": ["--stdio"],
"extensionToLanguage": {
".py": "python",
".pyi": "python"
}
}
}
}
Suggested Fix
The LSP server manager should either:
- Initialize after all plugins are loaded, or
- Re-register LSP servers after plugins finish loading, or
- Use a deferred/lazy initialization pattern for LSP servers
Workarounds Attempted (none worked)
- Reinstalling the plugin
- Complete restart of Claude Code
- Verifying all binaries are in PATH
- Checking
/pluginmenu shows no errors
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗