UAT: LspToolAdapter generates incorrect tool names — uses server-namespaced names instead of spec-defined lsp/* names #3524

Closed
opened 2026-04-05 18:54:36 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/lsp-tool-adapter-spec-names
  • Commit Message: fix(lsp): generate spec-defined lsp/* tool names in LspToolAdapter
  • Milestone: v3.6.0
  • Parent Epic: #824

What Was Tested

Code-level analysis of src/cleveragents/lsp/tool_adapter.py — specifically the LspToolAdapter.generate_tool_specs() method and the _CAPABILITY_TOOL_MAP constant.

Expected Behavior (from spec)

Per docs/specification.md (LSP Capability Exposure section), LSP capabilities are exposed to actors as tools with the following standardized names:

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 states: "When multiple LSP servers are bound to an actor (e.g., local/pyright for Python and local/typescript-lsp for TypeScript), the tool adapter routes requests to the appropriate server based on the file's detected language. The tool names remain the same — routing is transparent to the actor."

Actual Behavior (from code)

LspToolAdapter.generate_tool_specs() at line 218 of tool_adapter.py generates tool names as:

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

This produces names like local/pyright/diagnostics, local/pyright/hover, etc. — NOT the spec-defined lsp/diagnostics, lsp/hover, etc.

Impact

  • Actors cannot use standardized LSP tool names as documented in the spec
  • Multi-server routing transparency is broken — actors must know which specific server to call
  • Any actor configuration or prompt that references lsp/diagnostics (as the spec shows) will fail to find the tool
  • The spec's promise that "tool names remain the same" across multiple bound servers is violated

Code Location

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

Steps to Reproduce

  1. Create an LspServerConfig with name="local/pyright" and capabilities=[LspCapability.DIAGNOSTICS]
  2. Create an LspToolAdapter and call generate_tool_specs(config)
  3. Observe that the returned tool spec has name="local/pyright/diagnostics" instead of name="lsp/diagnostics"

Subtasks

  • Fix LspToolAdapter.generate_tool_specs() to generate tool names as lsp/<capability_suffix> instead of <server_name>/<capability_suffix>
  • Implement transparent routing to the correct server based on file language when multiple servers are bound
  • Update unit tests in features/lsp_tool_adapter_coverage.feature and features/lsp_functional_runtime.feature
  • Verify all nox stages pass

Definition of Done

  • LspToolAdapter.generate_tool_specs() generates tool names matching the spec table (e.g., lsp/diagnostics, lsp/hover)
  • Multi-server routing is transparent to actors — actors call lsp/<capability> regardless of which server handles the request
  • All existing and new tests pass with no regressions
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/lsp-tool-adapter-spec-names` - **Commit Message**: `fix(lsp): generate spec-defined lsp/* tool names in LspToolAdapter` - **Milestone**: v3.6.0 - **Parent Epic**: #824 ## What Was Tested Code-level analysis of `src/cleveragents/lsp/tool_adapter.py` — specifically the `LspToolAdapter.generate_tool_specs()` method and the `_CAPABILITY_TOOL_MAP` constant. ## Expected Behavior (from spec) Per `docs/specification.md` (LSP Capability Exposure section), LSP capabilities are exposed to actors as tools with the following standardized names: | 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 states: "When multiple LSP servers are bound to an actor (e.g., `local/pyright` for Python and `local/typescript-lsp` for TypeScript), the tool adapter routes requests to the appropriate server based on the file's detected language. The tool names remain the same — routing is transparent to the actor." ## Actual Behavior (from code) `LspToolAdapter.generate_tool_specs()` at line 218 of `tool_adapter.py` generates tool names as: ```python tool_name = f"{config.name}/{suffix}" ``` This produces names like `local/pyright/diagnostics`, `local/pyright/hover`, etc. — NOT the spec-defined `lsp/diagnostics`, `lsp/hover`, etc. ## Impact - Actors cannot use standardized LSP tool names as documented in the spec - Multi-server routing transparency is broken — actors must know which specific server to call - Any actor configuration or prompt that references `lsp/diagnostics` (as the spec shows) will fail to find the tool - The spec's promise that "tool names remain the same" across multiple bound servers is violated ## Code Location - `src/cleveragents/lsp/tool_adapter.py`, line 218: `tool_name = f"{config.name}/{suffix}"` ## Steps to Reproduce 1. Create an `LspServerConfig` with `name="local/pyright"` and `capabilities=[LspCapability.DIAGNOSTICS]` 2. Create an `LspToolAdapter` and call `generate_tool_specs(config)` 3. Observe that the returned tool spec has `name="local/pyright/diagnostics"` instead of `name="lsp/diagnostics"` ## Subtasks - [ ] Fix `LspToolAdapter.generate_tool_specs()` to generate tool names as `lsp/<capability_suffix>` instead of `<server_name>/<capability_suffix>` - [ ] Implement transparent routing to the correct server based on file language when multiple servers are bound - [ ] Update unit tests in `features/lsp_tool_adapter_coverage.feature` and `features/lsp_functional_runtime.feature` - [ ] Verify all nox stages pass ## Definition of Done - [ ] `LspToolAdapter.generate_tool_specs()` generates tool names matching the spec table (e.g., `lsp/diagnostics`, `lsp/hover`) - [ ] Multi-server routing is transparent to actors — actors call `lsp/<capability>` regardless of which server handles the request - [ ] All existing and new tests pass with no regressions - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.6.0 milestone 2026-04-05 18:54:41 +00:00
Author
Owner

Closing as duplicate of #3397.

Both issues describe the same bug: LspToolAdapter.generate_tool_specs() generates tool names using <server_name>/<suffix> format instead of the spec-required lsp/<suffix> format. Issue #3397 is the established tracking issue with State/Verified, Priority/Critical, and MoSCoW/Must Have labels on milestone v3.6.0. Please track this work in #3397.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Closing as duplicate of #3397. Both issues describe the same bug: `LspToolAdapter.generate_tool_specs()` generates tool names using `<server_name>/<suffix>` format instead of the spec-required `lsp/<suffix>` format. Issue #3397 is the established tracking issue with `State/Verified`, `Priority/Critical`, and `MoSCoW/Must Have` labels on milestone v3.6.0. Please track this work in #3397. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Author
Owner

Issue verified and triaged:

  • Priority: Critical — LspToolAdapter generates server-namespaced tool names instead of spec-defined lsp/* names, breaking multi-server routing transparency.
  • Milestone: v3.6.0 (already assigned)
  • Story Points: 3 (M) — focused fix to tool name generation plus implementing transparent language-based routing.
  • Parent Epic: #824 (already linked)
  • Next step: This issue is now ready for implementation.

Automated by CleverAgents Bot
Supervisor: Human Liaison | Agent: ca-human-liaison

Issue verified and triaged: - **Priority**: Critical — LspToolAdapter generates server-namespaced tool names instead of spec-defined `lsp/*` names, breaking multi-server routing transparency. - **Milestone**: v3.6.0 (already assigned) - **Story Points**: 3 (M) — focused fix to tool name generation plus implementing transparent language-based routing. - **Parent Epic**: #824 (already linked) - **Next step**: This issue is now ready for implementation. --- **Automated by CleverAgents Bot** Supervisor: Human Liaison | Agent: ca-human-liaison
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#3524
No description provided.