UAT: LspBinding model missing "by language" binding mode — only supports "by name" and "auto" #4669

Open
opened 2026-04-08 17:59:00 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Actor YAML — lsp_binding field
Severity: Medium — users cannot bind LSP servers by language without specifying a server name
Source: src/cleveragents/lsp/models.py


What Was Tested

Code-level analysis of the LspBinding model against the spec's description of actor YAML lsp_binding field binding modes.

Expected Behavior (from spec)

The spec (Section "Actor YAML Schema — LSP Bindings") describes three binding modes for the lsp_binding field in actor YAML:

  1. By name — bind to a specific registered LSP server by its namespaced name:

    lsp_binding:
      server: local/pyright
    
  2. By language — bind to any registered LSP server that supports the specified language(s), auto-selected from the registry:

    lsp_binding:
      language: python
    
  3. Auto — automatically detect the language from file context and select the appropriate server:

    lsp_binding:
      auto: true
    

Actual Behavior

The LspBinding model in src/cleveragents/lsp/models.py only supports two modes:

class LspBinding(BaseModel):
    node_name: str          # Name of the actor graph node
    lsp_server_name: str    # Namespaced name of the LSP server (by name only)
    languages: list[str]    # Subset of languages to bind (empty = all)
    auto_detect: bool       # Whether to auto-detect language from file context

Missing: There is no language field for "by language" binding mode. The lsp_server_name field is required (no default), which means every binding MUST specify a server name. Users cannot bind by language alone — they must always know the exact server name.

The languages field appears to be a filter (subset of languages to bind when using a named server), not a "by language" selector.

Code Location

  • src/cleveragents/lsp/models.pyLspBinding class

Impact

Users who want to bind an actor node to "whatever Python LSP server is registered" cannot do so. They must always hardcode the server name (e.g., local/pyright), which reduces portability of actor YAML files across different environments.

Fix

Add an optional language field to LspBinding and make lsp_server_name optional:

class LspBinding(BaseModel):
    node_name: str
    lsp_server_name: str | None = None   # By name (optional)
    language: str | None = None          # By language (optional)
    languages: list[str] = []            # Language filter
    auto_detect: bool = True             # Auto mode

    @model_validator(mode="after")
    def _validate_binding_mode(self) -> "LspBinding":
        if not self.lsp_server_name and not self.language and not self.auto_detect:
            raise ValueError(
                "LspBinding must specify at least one of: "
                "lsp_server_name, language, or auto_detect=True"
            )
        return self

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

## Bug Report **Feature Area:** Actor YAML — `lsp_binding` field **Severity:** Medium — users cannot bind LSP servers by language without specifying a server name **Source:** `src/cleveragents/lsp/models.py` --- ## What Was Tested Code-level analysis of the `LspBinding` model against the spec's description of actor YAML `lsp_binding` field binding modes. ## Expected Behavior (from spec) The spec (Section "Actor YAML Schema — LSP Bindings") describes three binding modes for the `lsp_binding` field in actor YAML: 1. **By name** — bind to a specific registered LSP server by its namespaced name: ```yaml lsp_binding: server: local/pyright ``` 2. **By language** — bind to any registered LSP server that supports the specified language(s), auto-selected from the registry: ```yaml lsp_binding: language: python ``` 3. **Auto** — automatically detect the language from file context and select the appropriate server: ```yaml lsp_binding: auto: true ``` ## Actual Behavior The `LspBinding` model in `src/cleveragents/lsp/models.py` only supports two modes: ```python class LspBinding(BaseModel): node_name: str # Name of the actor graph node lsp_server_name: str # Namespaced name of the LSP server (by name only) languages: list[str] # Subset of languages to bind (empty = all) auto_detect: bool # Whether to auto-detect language from file context ``` **Missing:** There is no `language` field for "by language" binding mode. The `lsp_server_name` field is **required** (no default), which means every binding MUST specify a server name. Users cannot bind by language alone — they must always know the exact server name. The `languages` field appears to be a filter (subset of languages to bind when using a named server), not a "by language" selector. ## Code Location - `src/cleveragents/lsp/models.py` — `LspBinding` class ## Impact Users who want to bind an actor node to "whatever Python LSP server is registered" cannot do so. They must always hardcode the server name (e.g., `local/pyright`), which reduces portability of actor YAML files across different environments. ## Fix Add an optional `language` field to `LspBinding` and make `lsp_server_name` optional: ```python class LspBinding(BaseModel): node_name: str lsp_server_name: str | None = None # By name (optional) language: str | None = None # By language (optional) languages: list[str] = [] # Language filter auto_detect: bool = True # Auto mode @model_validator(mode="after") def _validate_binding_mode(self) -> "LspBinding": if not self.lsp_server_name and not self.language and not self.auto_detect: raise ValueError( "LspBinding must specify at least one of: " "lsp_server_name, language, or auto_detect=True" ) return self ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.6.0 milestone 2026-04-08 18:05:29 +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#4669
No description provided.