[BUG] LspRuntime only implements 4 of 11 spec-required LSP capability tool handlers — 7 capabilities raise LspNotAvailableError #9149

Open
opened 2026-04-14 08:36:53 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit Message: fix(lsp): implement 7 missing LSP capability handlers in LspRuntime and LspToolAdapter
  • Branch: fix/lsp-runtime-missing-capability-handlers

Background and Context

The specification (docs/specification.md §LSP Capability Exposure, lines 20860–20880) defines an "Available LSP tools" table listing 11 capabilities that must be exposed as callable tools via LSPToolAdapter: diagnostics, hover, completions, definitions, references, rename, code_actions, formatting, signature_help, document_symbols, workspace_symbols.

src/cleveragents/lsp/tool_adapter.py _make_runtime_handler() (lines ~108–170) only implements 4 of these: DIAGNOSTICS, COMPLETIONS, HOVER, DEFINITIONS. The remaining 7 — REFERENCES, RENAME, CODE_ACTIONS, FORMATTING, SIGNATURE_HELP, DOCUMENT_SYMBOLS, WORKSPACE_SYMBOLS — fall through to a raise LspNotAvailableError(...) with message "not yet implemented", even when a fully functional LspRuntime is provided.

Similarly, LspRuntime (src/cleveragents/lsp/runtime.py) has no get_references(), get_rename(), get_code_actions(), get_formatting(), get_signature_help(), get_document_symbols(), or get_workspace_symbols() methods.

Parent Epic: #824 (Epic: LSP Functional Runtime)

Expected Behavior

All 11 LSP capabilities listed in the spec's "Available LSP tools" table must be callable via the LspRuntime when a server is running. The LspToolAdapter._make_runtime_handler() must delegate each capability to a corresponding LspRuntime method. No capability should raise LspNotAvailableError when a runtime is active.

Actual Behavior

src/cleveragents/lsp/tool_adapter.py _make_runtime_handler() (lines ~108–170) only implements 4 capabilities: DIAGNOSTICS, COMPLETIONS, HOVER, DEFINITIONS. The remaining 7 — REFERENCES, RENAME, CODE_ACTIONS, FORMATTING, SIGNATURE_HELP, DOCUMENT_SYMBOLS, WORKSPACE_SYMBOLS — fall through to a raise LspNotAvailableError(...) with message "not yet implemented", even when a fully functional LspRuntime is provided.

Steps to Reproduce:

  1. Register a language server: agents lsp add --config pyright.yaml
  2. Create an actor with lsp: [local/pyright] and lsp_capabilities: [references]
  3. Run the actor: agents actor run local/my-actor "find all references to Foo"
  4. The actor attempts to call lsp/references tool
  5. Observe: LspNotAvailableError: LSP capability 'references' is not yet implemented for server 'local/pyright' — even though a runtime is active

Acceptance Criteria

  • All 11 spec-required LSP capabilities are callable via LspRuntime when a server is running
  • LspToolAdapter._make_runtime_handler() delegates all 11 capabilities to corresponding LspRuntime methods
  • No capability raises LspNotAvailableError in server mode
  • LspRuntime exposes get_references(), get_rename(), get_code_actions(), get_formatting(), get_signature_help(), get_document_symbols(), and get_workspace_symbols() methods
  • Each new LspRuntime method delegates to the corresponding LspClient method
  • Unit tests cover each new capability handler
  • All nox stages pass with coverage ≥ 97%

Subtasks

  • Add get_references(name, file_path, line, column) to LspRuntime — sends textDocument/references via LspClient
  • Add get_rename(name, file_path, line, column, new_name) to LspRuntime — sends textDocument/rename
  • Add get_code_actions(name, file_path, line, column) to LspRuntime — sends textDocument/codeAction
  • Add get_formatting(name, file_path) to LspRuntime — sends textDocument/formatting
  • Add get_signature_help(name, file_path, line, column) to LspRuntime — sends textDocument/signatureHelp
  • Add get_document_symbols(name, file_path) to LspRuntime — sends textDocument/documentSymbol
  • Add get_workspace_symbols(name, query) to LspRuntime — sends workspace/symbol
  • Add corresponding LspClient methods for each new LSP request
  • Wire all 7 new methods into _make_runtime_handler() in tool_adapter.py
  • Add unit tests for each new capability handler
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is closed when:

  • All 11 spec-required LSP capabilities are callable via LspRuntime and exposed as tools by LspToolAdapter when a runtime is provided
  • No capability raises LspNotAvailableError in server mode
  • All subtasks are checked off
  • 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
  • The commit is pushed to the remote on the branch fix/lsp-runtime-missing-capability-handlers
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done
  • All nox stages pass with coverage ≥ 97%

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit Message**: `fix(lsp): implement 7 missing LSP capability handlers in LspRuntime and LspToolAdapter` - **Branch**: `fix/lsp-runtime-missing-capability-handlers` ## Background and Context The specification (`docs/specification.md` §LSP Capability Exposure, lines 20860–20880) defines an "Available LSP tools" table listing 11 capabilities that must be exposed as callable tools via `LSPToolAdapter`: `diagnostics`, `hover`, `completions`, `definitions`, `references`, `rename`, `code_actions`, `formatting`, `signature_help`, `document_symbols`, `workspace_symbols`. `src/cleveragents/lsp/tool_adapter.py` `_make_runtime_handler()` (lines ~108–170) only implements 4 of these: `DIAGNOSTICS`, `COMPLETIONS`, `HOVER`, `DEFINITIONS`. The remaining 7 — `REFERENCES`, `RENAME`, `CODE_ACTIONS`, `FORMATTING`, `SIGNATURE_HELP`, `DOCUMENT_SYMBOLS`, `WORKSPACE_SYMBOLS` — fall through to a `raise LspNotAvailableError(...)` with message `"not yet implemented"`, even when a fully functional `LspRuntime` is provided. Similarly, `LspRuntime` (`src/cleveragents/lsp/runtime.py`) has no `get_references()`, `get_rename()`, `get_code_actions()`, `get_formatting()`, `get_signature_help()`, `get_document_symbols()`, or `get_workspace_symbols()` methods. **Parent Epic:** #824 (Epic: LSP Functional Runtime) ## Expected Behavior All 11 LSP capabilities listed in the spec's "Available LSP tools" table must be callable via the `LspRuntime` when a server is running. The `LspToolAdapter._make_runtime_handler()` must delegate each capability to a corresponding `LspRuntime` method. No capability should raise `LspNotAvailableError` when a runtime is active. ## Actual Behavior `src/cleveragents/lsp/tool_adapter.py` `_make_runtime_handler()` (lines ~108–170) only implements 4 capabilities: `DIAGNOSTICS`, `COMPLETIONS`, `HOVER`, `DEFINITIONS`. The remaining 7 — `REFERENCES`, `RENAME`, `CODE_ACTIONS`, `FORMATTING`, `SIGNATURE_HELP`, `DOCUMENT_SYMBOLS`, `WORKSPACE_SYMBOLS` — fall through to a `raise LspNotAvailableError(...)` with message `"not yet implemented"`, even when a fully functional `LspRuntime` is provided. **Steps to Reproduce:** 1. Register a language server: `agents lsp add --config pyright.yaml` 2. Create an actor with `lsp: [local/pyright]` and `lsp_capabilities: [references]` 3. Run the actor: `agents actor run local/my-actor "find all references to Foo"` 4. The actor attempts to call `lsp/references` tool 5. Observe: `LspNotAvailableError: LSP capability 'references' is not yet implemented for server 'local/pyright'` — even though a runtime is active ## Acceptance Criteria - [ ] All 11 spec-required LSP capabilities are callable via `LspRuntime` when a server is running - [ ] `LspToolAdapter._make_runtime_handler()` delegates all 11 capabilities to corresponding `LspRuntime` methods - [ ] No capability raises `LspNotAvailableError` in server mode - [ ] `LspRuntime` exposes `get_references()`, `get_rename()`, `get_code_actions()`, `get_formatting()`, `get_signature_help()`, `get_document_symbols()`, and `get_workspace_symbols()` methods - [ ] Each new `LspRuntime` method delegates to the corresponding `LspClient` method - [ ] Unit tests cover each new capability handler - [ ] All nox stages pass with coverage ≥ 97% ## Subtasks - [ ] Add `get_references(name, file_path, line, column)` to `LspRuntime` — sends `textDocument/references` via `LspClient` - [ ] Add `get_rename(name, file_path, line, column, new_name)` to `LspRuntime` — sends `textDocument/rename` - [ ] Add `get_code_actions(name, file_path, line, column)` to `LspRuntime` — sends `textDocument/codeAction` - [ ] Add `get_formatting(name, file_path)` to `LspRuntime` — sends `textDocument/formatting` - [ ] Add `get_signature_help(name, file_path, line, column)` to `LspRuntime` — sends `textDocument/signatureHelp` - [ ] Add `get_document_symbols(name, file_path)` to `LspRuntime` — sends `textDocument/documentSymbol` - [ ] Add `get_workspace_symbols(name, query)` to `LspRuntime` — sends `workspace/symbol` - [ ] Add corresponding `LspClient` methods for each new LSP request - [ ] Wire all 7 new methods into `_make_runtime_handler()` in `tool_adapter.py` - [ ] Add unit tests for each new capability handler - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is closed when: - All 11 spec-required LSP capabilities are callable via `LspRuntime` and exposed as tools by `LspToolAdapter` when a runtime is provided - No capability raises `LspNotAvailableError` in server mode - All subtasks are checked off - 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 - The commit is pushed to the remote on the branch `fix/lsp-runtime-missing-capability-handlers` - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done - All nox stages pass with coverage ≥ 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
HAL9000 added this to the v3.2.0 milestone 2026-04-14 08:50:10 +00:00
Author
Owner

Triage: Verified [AUTO-OWNR-1]

Valid bug: LspRuntime only implements 4 of 11 spec-required LSP capability tool handlers — 7 capabilities raise LspNotAvailableError. This is a significant functional gap in LSP integration.

Assigning to v3.2.0 as LSP integration is a core M3 feature. Priority High — 7 of 11 LSP capabilities are non-functional.

MoSCoW: Must Have — LSP integration must implement all spec-required capabilities to be considered complete.


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

✅ **Triage: Verified** [AUTO-OWNR-1] Valid bug: `LspRuntime` only implements 4 of 11 spec-required LSP capability tool handlers — 7 capabilities raise `LspNotAvailableError`. This is a significant functional gap in LSP integration. Assigning to **v3.2.0** as LSP integration is a core M3 feature. Priority **High** — 7 of 11 LSP capabilities are non-functional. MoSCoW: **Must Have** — LSP integration must implement all spec-required capabilities to be considered complete. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#9149
No description provided.