UAT: LspToolAdapter generates wrong tool names — uses <server_name>/<capability> instead of spec-required lsp/<capability> #4872

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

Bug Report

Feature Area: LSP Integration — LSPToolAdapter

What Was Tested

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

Expected Behavior (from spec)

ADR-027 explicitly specifies tool names in the lsp/<capability> namespace:

lsp/diagnostics(file_path: str) -> list[Diagnostic]
lsp/hover(file_path: str, line: int, column: int) -> HoverResult
lsp/definition(file_path: str, line: int, column: int) -> list[Location]
lsp/references(file_path: str, line: int, column: int) -> list[Location]
lsp/completions(file_path: str, line: int, column: int) -> list[CompletionItem]
lsp/rename(file_path: str, line: int, column: int, new_name: str) -> WorkspaceEdit
lsp/code-actions(file_path: str, ...) -> list[CodeAction]
lsp/format(file_path: str) -> FormattedText
lsp/symbols(file_path: str) -> list[DocumentSymbol]
lsp/workspace-symbols(query: str) -> list[SymbolInformation]
lsp/signature(file_path: str, line: int, column: int) -> SignatureHelp

The spec also states: "The tool names remain the same — the routing is transparent to the actor." This means actors always call lsp/diagnostics regardless of which server (pyright, ruff-lsp, etc.) handles the request.

Actual Behavior

In tool_adapter.py, generate_tool_specs() constructs tool names as:

tool_name = f"{config.name}/{suffix}"

Where config.name is the namespaced server name (e.g., local/pyright). This produces tool names like:

  • local/pyright/diagnostics (should be lsp/diagnostics)
  • local/pyright/hover (should be lsp/hover)
  • local/ruff-lsp/diagnostics (should be lsp/diagnostics)

Impact

  • Actors cannot use the documented lsp/diagnostics tool name — they must know the specific server name
  • When multiple servers are bound (e.g., pyright for Python, typescript-language-server for TypeScript), the actor gets different tool names per server, breaking the "transparent routing" guarantee
  • All actor YAML examples in the spec that reference lsp/diagnostics etc. will fail at runtime
  • The spec's promise that "routing is transparent to the actor" is violated

Code Location

src/cleveragents/lsp/tool_adapter.py, line ~130:

tool_name = f"{config.name}/{suffix}"

Should be:

tool_name = f"lsp/{suffix}"

The adapter should route internally based on file language, not expose server-specific names.

Steps to Reproduce

  1. Register local/pyright with capabilities=[LspCapability.DIAGNOSTICS]
  2. Create LspToolAdapter and call generate_tool_specs(config)
  3. Observe tool name is local/pyright/diagnostics instead of lsp/diagnostics

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

## Bug Report **Feature Area:** LSP Integration — LSPToolAdapter ### What Was Tested Code analysis of `src/cleveragents/lsp/tool_adapter.py` against ADR-027 (Language Server Protocol Integration). ### Expected Behavior (from spec) ADR-027 explicitly specifies tool names in the `lsp/<capability>` namespace: ``` lsp/diagnostics(file_path: str) -> list[Diagnostic] lsp/hover(file_path: str, line: int, column: int) -> HoverResult lsp/definition(file_path: str, line: int, column: int) -> list[Location] lsp/references(file_path: str, line: int, column: int) -> list[Location] lsp/completions(file_path: str, line: int, column: int) -> list[CompletionItem] lsp/rename(file_path: str, line: int, column: int, new_name: str) -> WorkspaceEdit lsp/code-actions(file_path: str, ...) -> list[CodeAction] lsp/format(file_path: str) -> FormattedText lsp/symbols(file_path: str) -> list[DocumentSymbol] lsp/workspace-symbols(query: str) -> list[SymbolInformation] lsp/signature(file_path: str, line: int, column: int) -> SignatureHelp ``` The spec also states: **"The tool names remain the same — the routing is transparent to the actor."** This means actors always call `lsp/diagnostics` regardless of which server (pyright, ruff-lsp, etc.) handles the request. ### Actual Behavior In `tool_adapter.py`, `generate_tool_specs()` constructs tool names as: ```python tool_name = f"{config.name}/{suffix}" ``` Where `config.name` is the namespaced server name (e.g., `local/pyright`). This produces tool names like: - `local/pyright/diagnostics` ❌ (should be `lsp/diagnostics`) - `local/pyright/hover` ❌ (should be `lsp/hover`) - `local/ruff-lsp/diagnostics` ❌ (should be `lsp/diagnostics`) ### Impact - Actors cannot use the documented `lsp/diagnostics` tool name — they must know the specific server name - When multiple servers are bound (e.g., pyright for Python, typescript-language-server for TypeScript), the actor gets different tool names per server, breaking the "transparent routing" guarantee - All actor YAML examples in the spec that reference `lsp/diagnostics` etc. will fail at runtime - The spec's promise that "routing is transparent to the actor" is violated ### Code Location `src/cleveragents/lsp/tool_adapter.py`, line ~130: ```python tool_name = f"{config.name}/{suffix}" ``` Should be: ```python tool_name = f"lsp/{suffix}" ``` The adapter should route internally based on file language, not expose server-specific names. ### Steps to Reproduce 1. Register `local/pyright` with `capabilities=[LspCapability.DIAGNOSTICS]` 2. Create `LspToolAdapter` and call `generate_tool_specs(config)` 3. Observe tool name is `local/pyright/diagnostics` instead of `lsp/diagnostics` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 20:15:49 +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#4872
No description provided.