UAT: LspClient.initialize() never sends workspace/didChangeConfigurationLspServerConfig.workspace_settings silently ignored #2582

Open
opened 2026-04-03 19:00:09 +00:00 by freemo · 1 comment
Owner

Bug Report

Feature Area

Standards Alignment — LSP (Language Server Protocol) Integration

What Was Tested

Code-level analysis of src/cleveragents/lsp/client.py and src/cleveragents/lsp/models.py — the workspace_settings field and its usage in the initialize handshake.

Expected Behavior (from spec)

The LspServerConfig model (src/cleveragents/lsp/models.py) defines:

workspace_settings: dict[str, Any] = Field(
    default_factory=dict,
    description=(
        "Workspace configuration sent via "
        "workspace/didChangeConfiguration after initialization"
    ),
)

Per the LSP specification, after the initialize/initialized handshake completes, the client should send workspace/didChangeConfiguration with the server's workspace settings to configure the language server for the specific workspace.

Actual Behavior (from code)

In src/cleveragents/lsp/client.py, the initialize() method:

  1. Sends initialize request ✓
  2. Sends initialized notification ✓
  3. Never sends workspace/didChangeConfiguration
def initialize(self, workspace_path: str, initialization_options: dict[str, Any] | None = None) -> dict[str, Any]:
    ...
    result = self._send_request("initialize", params)
    self._server_capabilities = result.get("capabilities", {})
    self._initialized = True
    # Send initialized notification
    self._send_notification("initialized", {})
    # ← workspace/didChangeConfiguration is NEVER sent
    return result

The LspLifecycleManager.start_server() calls client.initialize(workspace_path) but never passes workspace_settings from the config, and LspClient.initialize() has no parameter for workspace settings.

Impact

  • Language servers misconfigured: LSP servers that require workspace settings (e.g., Pyright's python.pythonPath, TypeScript's typescript.tsdk) will use default settings instead of the configured ones.
  • workspace_settings field is dead code: The field is defined, documented, and validated but never used.
  • Subtle failures: Language servers may silently use wrong settings, producing incorrect diagnostics or completions without any error.

Code Location

  • src/cleveragents/lsp/client.pyinitialize() method (no workspace/didChangeConfiguration)
  • src/cleveragents/lsp/lifecycle.pystart_server() doesn't pass workspace_settings to client
  • src/cleveragents/lsp/models.pyLspServerConfig.workspace_settings (defined but unused)

Fix Required

  1. Add workspace_settings parameter to LspClient.initialize().
  2. After sending initialized notification, if workspace_settings is non-empty, send:
    self._send_notification("workspace/didChangeConfiguration", {
        "settings": workspace_settings
    })
    
  3. Update LspLifecycleManager.start_server() to pass config.workspace_settings to client.initialize().

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Bug Report ### Feature Area Standards Alignment — LSP (Language Server Protocol) Integration ### What Was Tested Code-level analysis of `src/cleveragents/lsp/client.py` and `src/cleveragents/lsp/models.py` — the `workspace_settings` field and its usage in the initialize handshake. ### Expected Behavior (from spec) The `LspServerConfig` model (`src/cleveragents/lsp/models.py`) defines: ```python workspace_settings: dict[str, Any] = Field( default_factory=dict, description=( "Workspace configuration sent via " "workspace/didChangeConfiguration after initialization" ), ) ``` Per the LSP specification, after the `initialize`/`initialized` handshake completes, the client should send `workspace/didChangeConfiguration` with the server's workspace settings to configure the language server for the specific workspace. ### Actual Behavior (from code) In `src/cleveragents/lsp/client.py`, the `initialize()` method: 1. Sends `initialize` request ✓ 2. Sends `initialized` notification ✓ 3. **Never sends `workspace/didChangeConfiguration`** ✗ ```python def initialize(self, workspace_path: str, initialization_options: dict[str, Any] | None = None) -> dict[str, Any]: ... result = self._send_request("initialize", params) self._server_capabilities = result.get("capabilities", {}) self._initialized = True # Send initialized notification self._send_notification("initialized", {}) # ← workspace/didChangeConfiguration is NEVER sent return result ``` The `LspLifecycleManager.start_server()` calls `client.initialize(workspace_path)` but never passes `workspace_settings` from the config, and `LspClient.initialize()` has no parameter for workspace settings. ### Impact - **Language servers misconfigured**: LSP servers that require workspace settings (e.g., Pyright's `python.pythonPath`, TypeScript's `typescript.tsdk`) will use default settings instead of the configured ones. - **`workspace_settings` field is dead code**: The field is defined, documented, and validated but never used. - **Subtle failures**: Language servers may silently use wrong settings, producing incorrect diagnostics or completions without any error. ### Code Location - `src/cleveragents/lsp/client.py` — `initialize()` method (no `workspace/didChangeConfiguration`) - `src/cleveragents/lsp/lifecycle.py` — `start_server()` doesn't pass `workspace_settings` to client - `src/cleveragents/lsp/models.py` — `LspServerConfig.workspace_settings` (defined but unused) ### Fix Required 1. Add `workspace_settings` parameter to `LspClient.initialize()`. 2. After sending `initialized` notification, if `workspace_settings` is non-empty, send: ```python self._send_notification("workspace/didChangeConfiguration", { "settings": workspace_settings }) ``` 3. Update `LspLifecycleManager.start_server()` to pass `config.workspace_settings` to `client.initialize()`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Should Have

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Should Have --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.6.0 milestone 2026-04-05 04:53:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#2582
No description provided.