UAT: LspRegistry missing for_language() method required by Jinja2 template variable spec #4877

Open
opened 2026-04-08 20:12:25 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: LSP Integration — LSP Registry

What Was Tested

Code analysis of src/cleveragents/lsp/registry.py against ADR-027 (Language Server Protocol Integration).

Expected Behavior (from spec)

ADR-027 documents Jinja2 dynamic binding with the following template variables:

Variable Type Description
lsp_registry object The LSP Registry, supporting .for_language(lang) and .all() queries.

The spec shows this usage:

lsp:
  {% for lang in context.project_languages %}
  - {{ lsp_registry.for_language(lang) | first }}
  {% endfor %}

This requires LspRegistry to expose a for_language(lang) method that returns a list of server configs matching the given language.

Actual Behavior

LspRegistry in registry.py has:

  • register(), get(), get_or_raise(), list_servers(), remove()
  • list_servers(language=...) — filters by language but is not named for_language()

There is no for_language() method. Jinja2 templates using lsp_registry.for_language(lang) will raise AttributeError.

Additionally, the spec mentions .all() queries but there is no all() method either (only list_servers() with no arguments achieves this).

Impact

  • Jinja2 dynamic LSP binding (the most flexible binding mode) is broken
  • Actor YAML files using {% for lang in context.project_languages %} pattern will fail at template preprocessing time
  • The lsp_registry Jinja2 template variable cannot be properly exposed without these methods

Code Location

src/cleveragents/lsp/registry.py — missing methods:

def for_language(self, language: str) -> list[LspServerConfig]:
    """Return all servers that support the given language."""
    return self.list_servers(language=language)

def all(self) -> list[LspServerConfig]:
    """Return all registered servers."""
    return self.list_servers()

Steps to Reproduce

  1. Create an LspRegistry instance
  2. Call registry.for_language("python")
  3. Observe AttributeError: 'LspRegistry' object has no attribute 'for_language'

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

## Bug Report **Feature Area:** LSP Integration — LSP Registry ### What Was Tested Code analysis of `src/cleveragents/lsp/registry.py` against ADR-027 (Language Server Protocol Integration). ### Expected Behavior (from spec) ADR-027 documents Jinja2 dynamic binding with the following template variables: | Variable | Type | Description | |----------|------|-------------| | `lsp_registry` | object | The LSP Registry, supporting `.for_language(lang)` and `.all()` queries. | The spec shows this usage: ```yaml lsp: {% for lang in context.project_languages %} - {{ lsp_registry.for_language(lang) | first }} {% endfor %} ``` This requires `LspRegistry` to expose a `for_language(lang)` method that returns a list of server configs matching the given language. ### Actual Behavior `LspRegistry` in `registry.py` has: - `register()`, `get()`, `get_or_raise()`, `list_servers()`, `remove()` - `list_servers(language=...)` — filters by language but is not named `for_language()` There is no `for_language()` method. Jinja2 templates using `lsp_registry.for_language(lang)` will raise `AttributeError`. Additionally, the spec mentions `.all()` queries but there is no `all()` method either (only `list_servers()` with no arguments achieves this). ### Impact - Jinja2 dynamic LSP binding (the most flexible binding mode) is broken - Actor YAML files using `{% for lang in context.project_languages %}` pattern will fail at template preprocessing time - The `lsp_registry` Jinja2 template variable cannot be properly exposed without these methods ### Code Location `src/cleveragents/lsp/registry.py` — missing methods: ```python def for_language(self, language: str) -> list[LspServerConfig]: """Return all servers that support the given language.""" return self.list_servers(language=language) def all(self) -> list[LspServerConfig]: """Return all registered servers.""" return self.list_servers() ``` ### Steps to Reproduce 1. Create an `LspRegistry` instance 2. Call `registry.for_language("python")` 3. Observe `AttributeError: 'LspRegistry' object has no attribute 'for_language'` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 20:15:50 +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#4877
No description provided.