UAT: LspToolAdapter generates wrong tool names — uses server-namespaced format instead of spec-required lsp/ prefix #3397

Open
opened 2026-04-05 16:25:39 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/lsp-tool-adapter-name-format
  • Commit Message: fix(lsp): correct LspToolAdapter tool name generation to use lsp/ prefix
  • Milestone: v3.6.0
  • Parent Epic: #824

Bug Description

LspToolAdapter.generate_tool_specs() generates tool names in the format <server_name>/<capability_suffix> (e.g., local/pyright/diagnostics), but the specification requires tool names to use the lsp/ prefix format (e.g., lsp/diagnostics).

Expected Behavior (from spec)

Per docs/specification.md lines 20738–20751, LSP capability tool names are:

Capability Tool Name
diagnostics lsp/diagnostics
hover lsp/hover
completions lsp/completions
definitions lsp/definition
references lsp/references
rename lsp/rename
code_actions lsp/code-actions
formatting lsp/format
signature_help lsp/signature
document_symbols lsp/symbols
workspace_symbols lsp/workspace-symbols

The spec also states (line 20752): "When multiple LSP servers are bound to an actor... the tool names remain the same — routing is transparent to the actor."

Actual Behavior

In src/cleveragents/lsp/tool_adapter.py line 218:

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

For a server named local/pyright with diagnostics capability, this generates local/pyright/diagnostics instead of lsp/diagnostics.

Code Location

  • File: src/cleveragents/lsp/tool_adapter.py
  • Line 218: tool_name = f"{config.name}/{suffix}"

Steps to Reproduce

from cleveragents.lsp.tool_adapter import LspToolAdapter
from cleveragents.lsp.models import LspServerConfig, LspCapability

config = LspServerConfig(
    name="local/pyright",
    command="pyright-langserver",
    languages=["python"],
    capabilities=[LspCapability.DIAGNOSTICS, LspCapability.HOVER],
)
adapter = LspToolAdapter()
specs = adapter.generate_tool_specs(config)
print([s["name"] for s in specs])
# Actual:   ['local/pyright/diagnostics', 'local/pyright/hover']
# Expected: ['lsp/diagnostics', 'lsp/hover']

Impact

Actors that call LSP tools by the spec-defined names (lsp/diagnostics, lsp/hover, etc.) will fail to find them. The tool routing transparency described in the spec is broken — actors would need to know the server name to call LSP tools, defeating the purpose of the abstraction.

Subtasks

  • Fix generate_tool_specs() to use lsp/<suffix> as the tool name
  • Update routing logic to map lsp/<suffix> calls to the correct server based on file language
  • Update unit tests in features/lsp_tool_adapter_coverage.feature to assert correct tool names
  • Verify no other code depends on the old <server_name>/<suffix> format

Definition of Done

  • LspToolAdapter.generate_tool_specs() generates tool names matching the spec table
  • Actors can call lsp/diagnostics without knowing which server handles it
  • All nox stages pass
  • Coverage >= 97%

Parent: #824


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/lsp-tool-adapter-name-format` - **Commit Message**: `fix(lsp): correct LspToolAdapter tool name generation to use lsp/ prefix` - **Milestone**: v3.6.0 - **Parent Epic**: #824 ## Bug Description `LspToolAdapter.generate_tool_specs()` generates tool names in the format `<server_name>/<capability_suffix>` (e.g., `local/pyright/diagnostics`), but the specification requires tool names to use the `lsp/` prefix format (e.g., `lsp/diagnostics`). ## Expected Behavior (from spec) Per `docs/specification.md` lines 20738–20751, LSP capability tool names are: | Capability | Tool Name | |-----------|-----------| | `diagnostics` | `lsp/diagnostics` | | `hover` | `lsp/hover` | | `completions` | `lsp/completions` | | `definitions` | `lsp/definition` | | `references` | `lsp/references` | | `rename` | `lsp/rename` | | `code_actions` | `lsp/code-actions` | | `formatting` | `lsp/format` | | `signature_help` | `lsp/signature` | | `document_symbols` | `lsp/symbols` | | `workspace_symbols` | `lsp/workspace-symbols` | The spec also states (line 20752): "When multiple LSP servers are bound to an actor... the tool names remain the same — routing is transparent to the actor." ## Actual Behavior In `src/cleveragents/lsp/tool_adapter.py` line 218: ```python tool_name = f"{config.name}/{suffix}" ``` For a server named `local/pyright` with `diagnostics` capability, this generates `local/pyright/diagnostics` instead of `lsp/diagnostics`. ## Code Location - File: `src/cleveragents/lsp/tool_adapter.py` - Line 218: `tool_name = f"{config.name}/{suffix}"` ## Steps to Reproduce ```python from cleveragents.lsp.tool_adapter import LspToolAdapter from cleveragents.lsp.models import LspServerConfig, LspCapability config = LspServerConfig( name="local/pyright", command="pyright-langserver", languages=["python"], capabilities=[LspCapability.DIAGNOSTICS, LspCapability.HOVER], ) adapter = LspToolAdapter() specs = adapter.generate_tool_specs(config) print([s["name"] for s in specs]) # Actual: ['local/pyright/diagnostics', 'local/pyright/hover'] # Expected: ['lsp/diagnostics', 'lsp/hover'] ``` ## Impact Actors that call LSP tools by the spec-defined names (`lsp/diagnostics`, `lsp/hover`, etc.) will fail to find them. The tool routing transparency described in the spec is broken — actors would need to know the server name to call LSP tools, defeating the purpose of the abstraction. ## Subtasks - [ ] Fix `generate_tool_specs()` to use `lsp/<suffix>` as the tool name - [ ] Update routing logic to map `lsp/<suffix>` calls to the correct server based on file language - [ ] Update unit tests in `features/lsp_tool_adapter_coverage.feature` to assert correct tool names - [ ] Verify no other code depends on the old `<server_name>/<suffix>` format ## Definition of Done - [ ] `LspToolAdapter.generate_tool_specs()` generates tool names matching the spec table - [ ] Actors can call `lsp/diagnostics` without knowing which server handles it - [ ] All nox stages pass - [ ] Coverage >= 97% Parent: #824 --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-05 16:25:44 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Critical — LspToolAdapter generates wrong tool names using server-namespaced format instead of the spec-required lsp/ prefix. This breaks tool discovery and invocation for LSP-based tools.
  • Milestone: v3.6.0 (already set)
  • Story Points: 3 — M — Requires fixing the tool name generation logic in LspToolAdapter. Estimated 4-8 hours.
  • MoSCoW: Must Have — Incorrect tool names mean LSP tools cannot be discovered or invoked correctly. This is a functional bug.
  • Parent Epic: #824 (LSP Functional Runtime)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Critical — LspToolAdapter generates wrong tool names using server-namespaced format instead of the spec-required `lsp/` prefix. This breaks tool discovery and invocation for LSP-based tools. - **Milestone**: v3.6.0 (already set) - **Story Points**: 3 — M — Requires fixing the tool name generation logic in LspToolAdapter. Estimated 4-8 hours. - **MoSCoW**: Must Have — Incorrect tool names mean LSP tools cannot be discovered or invoked correctly. This is a functional bug. - **Parent Epic**: #824 (LSP Functional Runtime) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-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.

Blocks
#824 Epic: LSP Functional Runtime
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3397
No description provided.