UAT: 7 of 11 LSP capabilities registered as tools but raise LspNotAvailableError when called — runtime handlers incomplete #3534

Open
opened 2026-04-05 19:01:12 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/lsp-missing-runtime-handlers
  • Commit Message: fix(lsp): implement runtime handlers for 7 missing LSP capabilities
  • Milestone: (none — backlog)
  • Parent Epic: #824

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Background and Context

Per docs/specification.md (LSP Capability Exposure section), all 11 LSP capabilities must be exposed as callable tools that delegate to the LSP runtime via LspToolAdapter. Code-level analysis of src/cleveragents/lsp/tool_adapter.py reveals that _make_runtime_handler() only implements 4 of the 11 specified capabilities. The remaining 7 fall through to an error path and raise LspNotAvailableError, making those tool registrations non-functional despite appearing in the tool spec.

Current Behavior

_make_runtime_handler() in src/cleveragents/lsp/tool_adapter.py only implements 4 of 11 capabilities:

  • diagnostics — delegates to runtime.get_diagnostics()
  • completions — delegates to runtime.get_completions()
  • hover — delegates to runtime.get_hover()
  • definitions — delegates to runtime.get_definitions()

The remaining 7 capabilities fall through to the "not yet implemented" error path and raise LspNotAvailableError:

  • references — raises LspNotAvailableError
  • rename — raises LspNotAvailableError
  • code_actions — raises LspNotAvailableError
  • formatting — raises LspNotAvailableError
  • signature_help — raises LspNotAvailableError
  • document_symbols — raises LspNotAvailableError
  • workspace_symbols — raises LspNotAvailableError

Additionally, LspClient in src/cleveragents/lsp/client.py only implements get_diagnostics(), get_completions(), get_hover(), and get_definitions() — the 7 missing capabilities have no corresponding client methods. LspRuntime in src/cleveragents/lsp/runtime.py is similarly missing the 7 corresponding runtime methods.

Expected Behavior

Per docs/specification.md (LSP Capability Exposure section), all 11 LSP capabilities should be exposed as callable tools that delegate to the LSP runtime:

Capability Tool Name LSP Method
diagnostics lsp/diagnostics textDocument/publishDiagnostics
hover lsp/hover textDocument/hover
completions lsp/completions textDocument/completion
definitions lsp/definition textDocument/definition
references lsp/references textDocument/references
rename lsp/rename textDocument/rename
code_actions lsp/code-actions textDocument/codeAction
formatting lsp/format textDocument/formatting
signature_help lsp/signature textDocument/signatureHelp
document_symbols lsp/symbols textDocument/documentSymbol
workspace_symbols lsp/workspace-symbols workspace/symbol

Acceptance Criteria

  • All 11 LSP capabilities have working runtime handlers in LspToolAdapter._make_runtime_handler()
  • All 11 LSP capabilities have corresponding methods in LspClient and LspRuntime
  • Calling any of the 7 previously broken tool handlers with valid arguments returns a result (not LspNotAvailableError)
  • All nox stages pass; coverage >= 97%

Supporting Information

Steps to Reproduce:

  1. Create an LspServerConfig with capabilities=[LspCapability.REFERENCES]
  2. Create an LspToolAdapter with a runtime and call generate_tool_specs(config)
  3. Call the generated lsp/references tool handler with a valid file_path, line, column
  4. Observe LspNotAvailableError: LSP capability 'references' is not yet implemented

Code Locations:

  • src/cleveragents/lsp/tool_adapter.py, _make_runtime_handler() — missing handlers for 7 capabilities
  • src/cleveragents/lsp/client.py — missing methods for references, rename, code_actions, formatting, signature_help, document_symbols, workspace_symbols
  • src/cleveragents/lsp/runtime.py — missing runtime methods for the 7 unimplemented capabilities

Impact: Actors that configure LSP servers with capabilities like references, rename, code_actions, formatting, signature_help, document_symbols, or workspace_symbols will receive LspNotAvailableError when attempting to use those tools, even when a fully functional LSP server is running.

Subtasks

  • Add get_references() to LspClient (sends textDocument/references)
  • Add get_rename() to LspClient (sends textDocument/rename)
  • Add get_code_actions() to LspClient (sends textDocument/codeAction)
  • Add get_formatting() to LspClient (sends textDocument/formatting)
  • Add get_signature_help() to LspClient (sends textDocument/signatureHelp)
  • Add get_document_symbols() to LspClient (sends textDocument/documentSymbol)
  • Add get_workspace_symbols() to LspClient (sends workspace/symbol)
  • Add corresponding runtime methods to LspRuntime for all 7 capabilities
  • Wire all 7 capabilities in _make_runtime_handler() in tool_adapter.py
  • Tests (Behave): Add unit test scenarios for each new capability handler
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • All 11 LSP capabilities have working runtime handlers in LspToolAdapter, corresponding methods in LspClient and LspRuntime.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

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

## Metadata - **Branch**: `fix/lsp-missing-runtime-handlers` - **Commit Message**: `fix(lsp): implement runtime handlers for 7 missing LSP capabilities` - **Milestone**: *(none — backlog)* - **Parent Epic**: #824 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- ## Background and Context Per `docs/specification.md` (LSP Capability Exposure section), all 11 LSP capabilities must be exposed as callable tools that delegate to the LSP runtime via `LspToolAdapter`. Code-level analysis of `src/cleveragents/lsp/tool_adapter.py` reveals that `_make_runtime_handler()` only implements 4 of the 11 specified capabilities. The remaining 7 fall through to an error path and raise `LspNotAvailableError`, making those tool registrations non-functional despite appearing in the tool spec. ## Current Behavior `_make_runtime_handler()` in `src/cleveragents/lsp/tool_adapter.py` only implements 4 of 11 capabilities: - ✅ `diagnostics` — delegates to `runtime.get_diagnostics()` - ✅ `completions` — delegates to `runtime.get_completions()` - ✅ `hover` — delegates to `runtime.get_hover()` - ✅ `definitions` — delegates to `runtime.get_definitions()` The remaining 7 capabilities fall through to the "not yet implemented" error path and raise `LspNotAvailableError`: - ❌ `references` — raises `LspNotAvailableError` - ❌ `rename` — raises `LspNotAvailableError` - ❌ `code_actions` — raises `LspNotAvailableError` - ❌ `formatting` — raises `LspNotAvailableError` - ❌ `signature_help` — raises `LspNotAvailableError` - ❌ `document_symbols` — raises `LspNotAvailableError` - ❌ `workspace_symbols` — raises `LspNotAvailableError` Additionally, `LspClient` in `src/cleveragents/lsp/client.py` only implements `get_diagnostics()`, `get_completions()`, `get_hover()`, and `get_definitions()` — the 7 missing capabilities have no corresponding client methods. `LspRuntime` in `src/cleveragents/lsp/runtime.py` is similarly missing the 7 corresponding runtime methods. ## Expected Behavior Per `docs/specification.md` (LSP Capability Exposure section), all 11 LSP capabilities should be exposed as callable tools that delegate to the LSP runtime: | Capability | Tool Name | LSP Method | |---|---|---| | `diagnostics` | `lsp/diagnostics` | `textDocument/publishDiagnostics` | | `hover` | `lsp/hover` | `textDocument/hover` | | `completions` | `lsp/completions` | `textDocument/completion` | | `definitions` | `lsp/definition` | `textDocument/definition` | | `references` | `lsp/references` | `textDocument/references` | | `rename` | `lsp/rename` | `textDocument/rename` | | `code_actions` | `lsp/code-actions` | `textDocument/codeAction` | | `formatting` | `lsp/format` | `textDocument/formatting` | | `signature_help` | `lsp/signature` | `textDocument/signatureHelp` | | `document_symbols` | `lsp/symbols` | `textDocument/documentSymbol` | | `workspace_symbols` | `lsp/workspace-symbols` | `workspace/symbol` | ## Acceptance Criteria - All 11 LSP capabilities have working runtime handlers in `LspToolAdapter._make_runtime_handler()` - All 11 LSP capabilities have corresponding methods in `LspClient` and `LspRuntime` - Calling any of the 7 previously broken tool handlers with valid arguments returns a result (not `LspNotAvailableError`) - All nox stages pass; coverage >= 97% ## Supporting Information **Steps to Reproduce:** 1. Create an `LspServerConfig` with `capabilities=[LspCapability.REFERENCES]` 2. Create an `LspToolAdapter` with a runtime and call `generate_tool_specs(config)` 3. Call the generated `lsp/references` tool handler with a valid `file_path`, `line`, `column` 4. Observe `LspNotAvailableError: LSP capability 'references' is not yet implemented` **Code Locations:** - `src/cleveragents/lsp/tool_adapter.py`, `_make_runtime_handler()` — missing handlers for 7 capabilities - `src/cleveragents/lsp/client.py` — missing methods for `references`, `rename`, `code_actions`, `formatting`, `signature_help`, `document_symbols`, `workspace_symbols` - `src/cleveragents/lsp/runtime.py` — missing runtime methods for the 7 unimplemented capabilities **Impact:** Actors that configure LSP servers with capabilities like `references`, `rename`, `code_actions`, `formatting`, `signature_help`, `document_symbols`, or `workspace_symbols` will receive `LspNotAvailableError` when attempting to use those tools, even when a fully functional LSP server is running. ## Subtasks - [ ] Add `get_references()` to `LspClient` (sends `textDocument/references`) - [ ] Add `get_rename()` to `LspClient` (sends `textDocument/rename`) - [ ] Add `get_code_actions()` to `LspClient` (sends `textDocument/codeAction`) - [ ] Add `get_formatting()` to `LspClient` (sends `textDocument/formatting`) - [ ] Add `get_signature_help()` to `LspClient` (sends `textDocument/signatureHelp`) - [ ] Add `get_document_symbols()` to `LspClient` (sends `textDocument/documentSymbol`) - [ ] Add `get_workspace_symbols()` to `LspClient` (sends `workspace/symbol`) - [ ] Add corresponding runtime methods to `LspRuntime` for all 7 capabilities - [ ] Wire all 7 capabilities in `_make_runtime_handler()` in `tool_adapter.py` - [ ] Tests (Behave): Add unit test scenarios for each new capability handler - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - All 11 LSP capabilities have working runtime handlers in `LspToolAdapter`, corresponding methods in `LspClient` and `LspRuntime`. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — 7 of 11 LSP capabilities are registered as tools but raise errors when called. This means actors that configure these capabilities will encounter runtime failures. The spec requires all 11 capabilities to be functional.
  • Milestone: v3.6.0 — LSP functional runtime is in scope for M7 (Epic #824).
  • Story Points: 8 — XL — Requires implementing 7 new methods in LspClient, 7 corresponding runtime methods in LspRuntime, and 7 handler branches in LspToolAdapter, plus comprehensive Behave scenarios for each capability.
  • MoSCoW: Should Have — The 4 implemented capabilities (diagnostics, completions, hover, definitions) cover the most common use cases. The remaining 7 are important for full LSP compliance but not blocking basic code intelligence.
  • 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**: High — 7 of 11 LSP capabilities are registered as tools but raise errors when called. This means actors that configure these capabilities will encounter runtime failures. The spec requires all 11 capabilities to be functional. - **Milestone**: v3.6.0 — LSP functional runtime is in scope for M7 (Epic #824). - **Story Points**: 8 — XL — Requires implementing 7 new methods in LspClient, 7 corresponding runtime methods in LspRuntime, and 7 handler branches in LspToolAdapter, plus comprehensive Behave scenarios for each capability. - **MoSCoW**: Should Have — The 4 implemented capabilities (diagnostics, completions, hover, definitions) cover the most common use cases. The remaining 7 are important for full LSP compliance but not blocking basic code intelligence. - **Parent Epic**: #824 (LSP Functional Runtime) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.6.0 milestone 2026-04-05 19:37:44 +00:00
freemo removed this from the v3.6.0 milestone 2026-04-06 23:43:16 +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.

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