UAT: LspServerConfig allows empty languages list — spec JSON schema requires at least one language #5106

Open
opened 2026-04-09 01:02:28 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: LSP Registry / LspServerConfig model
Severity: Medium
Discovered by: UAT Testing (uat-pool-1, worker: Provider Registry and LSP Integration)


What Was Tested

Tested LspServerConfig model validation against the spec's JSON schema for LSP server configuration files.

Expected Behavior (from spec §LSP Server Configuration Files, line 36138)

The spec's JSON schema defines languages as:

"languages": {
  "type": "array",
  "items": { "type": "string" },
  "minItems": 1,
  "description": "Programming languages this server supports..."
}

And in the required array: ["name", "languages", "command"]

An LSP server with no languages is meaningless — the runtime uses languages to match servers to files and to resolve language-based actor bindings.

Actual Behavior

LspServerConfig in src/cleveragents/lsp/models.py defines languages as:

languages: list[str] = Field(
    default_factory=list,  # Defaults to empty list
    description="Programming languages served (e.g. ['python'])",
)

There is no min_length or min_items constraint. An empty languages list is accepted without error:

>>> from cleveragents.lsp.models import LspServerConfig
>>> c = LspServerConfig(name='local/test', command='test-server', languages=[])
>>> c.languages
[]  # No validation error!

Impact

  • An LSP server with no languages cannot be matched to any file or actor binding
  • Language-based actor bindings (lsp: {languages: [python]}) will never match a server with empty languages
  • Auto-discovery (lsp: {auto: true}) will never select a server with empty languages
  • The spec's JSON schema constraint (minItems: 1) is not enforced

Steps to Reproduce

from cleveragents.lsp.models import LspServerConfig
# Should raise ValidationError but doesn't:
config = LspServerConfig(name='local/test', command='test-server', languages=[])
print(config.languages)  # []

Suggested Fix

Add min_length=1 constraint to the languages field:

languages: list[str] = Field(
    default_factory=list,
    min_length=1,  # Enforce spec's minItems: 1
    description="Programming languages served (e.g. ['python'])",
)

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

## Bug Report **Feature Area:** LSP Registry / `LspServerConfig` model **Severity:** Medium **Discovered by:** UAT Testing (uat-pool-1, worker: Provider Registry and LSP Integration) --- ## What Was Tested Tested `LspServerConfig` model validation against the spec's JSON schema for LSP server configuration files. ## Expected Behavior (from spec §LSP Server Configuration Files, line 36138) The spec's JSON schema defines `languages` as: ```json "languages": { "type": "array", "items": { "type": "string" }, "minItems": 1, "description": "Programming languages this server supports..." } ``` And in the `required` array: `["name", "languages", "command"]` An LSP server with no languages is meaningless — the runtime uses languages to match servers to files and to resolve language-based actor bindings. ## Actual Behavior `LspServerConfig` in `src/cleveragents/lsp/models.py` defines `languages` as: ```python languages: list[str] = Field( default_factory=list, # Defaults to empty list description="Programming languages served (e.g. ['python'])", ) ``` There is no `min_length` or `min_items` constraint. An empty languages list is accepted without error: ```python >>> from cleveragents.lsp.models import LspServerConfig >>> c = LspServerConfig(name='local/test', command='test-server', languages=[]) >>> c.languages [] # No validation error! ``` ## Impact - An LSP server with no languages cannot be matched to any file or actor binding - Language-based actor bindings (`lsp: {languages: [python]}`) will never match a server with empty languages - Auto-discovery (`lsp: {auto: true}`) will never select a server with empty languages - The spec's JSON schema constraint (`minItems: 1`) is not enforced ## Steps to Reproduce ```python from cleveragents.lsp.models import LspServerConfig # Should raise ValidationError but doesn't: config = LspServerConfig(name='local/test', command='test-server', languages=[]) print(config.languages) # [] ``` ## Suggested Fix Add `min_length=1` constraint to the `languages` field: ```python languages: list[str] = Field( default_factory=list, min_length=1, # Enforce spec's minItems: 1 description="Programming languages served (e.g. ['python'])", ) ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:11:01 +00:00
Author
Owner

Issue triaged by project owner: Verified as valid spec compliance bug. Priority: Medium. Milestone: v3.2.0.


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

Issue triaged by project owner: Verified as valid spec compliance bug. Priority: Medium. Milestone: v3.2.0. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
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.

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