UAT: LSP integration misses required capabilities and bindings #6972

Open
opened 2026-04-10 06:07:22 +00:00 by HAL9000 · 0 comments
Owner

What was tested

  • Evaluated the LSP integration (Tool Adapter, Runtime, and YAML binding) against docs/specification.md for commit 51aab18411.

Expected behavior

  • LspToolAdapter should expose the full set of LSP capabilities listed in the spec (diagnostics, hover, completions, references, rename, code actions, signature help, formatting, symbol navigation, etc.) so actors can call them as tools.
  • LspRuntime.activate_bindings() should honor per-node YAML bindings (lsp_binding / lsp_bindings) so graph nodes automatically start the configured language servers.
  • Automatic context enrichment (LspContextEnrichment) should inject diagnostics/type info into ACMS when enabled in actor configs.

Actual behavior

  • LspToolAdapter._make_runtime_handler (src/cleveragents/lsp/tool_adapter.py, lines 107-167) only implements diagnostics, completions, hover, and go-to-definition. Every other capability falls through to a LspNotAvailableError. For example, generating a handler for LspCapability.RENAME immediately raises LspNotAvailableError when invoked.
  • Actor compilation ignores the schema-provided NodeLspBinding: NodeDefinition.lsp_binding is parsed, but _extract_lsp_bindings in src/cleveragents/actor/compiler.py only looks for node.config['lsp_bindings'], so CompilationMetadata.lsp_bindings is empty. LspRuntime.activate_bindings() is never invoked, so no bindings are activated at runtime.
  • LspContextEnrichment is defined in src/cleveragents/actor/schema.py but unused elsewhere—there is no code that consumes the setting to push diagnostics/type annotations into ACMS.

Steps to reproduce

  1. Run:
    from cleveragents.lsp.models import LspServerConfig, LspCapability
    from cleveragents.lsp.tool_adapter import LspToolAdapter
    from cleveragents.lsp.runtime import LspRuntime
    
    config = LspServerConfig(name='local/pyright', command='pyright-langserver', capabilities=[LspCapability.RENAME])
    handler = LspToolAdapter(runtime=LspRuntime()).generate_tool_specs(config)[0]['handler']
    handler(file_path='demo.py', line=1, column=1, new_name='foo')
    
    The handler raises LspNotAvailableError, showing the capability is not implemented.
  2. Compile an actor with NodeLspBinding(server='local/pyright') and inspect CompilationMetadata.lsp_bindings—the list is empty, so bindings are dropped.
  3. Search the codebase for lsp_context_enrichment; it is defined but never used, so enabling it in actor YAML has no effect.

Code location

  • src/cleveragents/lsp/tool_adapter.py
  • src/cleveragents/actor/schema.py
  • src/cleveragents/actor/compiler.py
  • src/cleveragents/lsp/runtime.py
## What was tested - Evaluated the LSP integration (Tool Adapter, Runtime, and YAML binding) against `docs/specification.md` for commit 51aab184112728471a44d5a91c334663cf8cd016. ## Expected behavior - `LspToolAdapter` should expose the full set of LSP capabilities listed in the spec (diagnostics, hover, completions, references, rename, code actions, signature help, formatting, symbol navigation, etc.) so actors can call them as tools. - `LspRuntime.activate_bindings()` should honor per-node YAML bindings (`lsp_binding` / `lsp_bindings`) so graph nodes automatically start the configured language servers. - Automatic context enrichment (`LspContextEnrichment`) should inject diagnostics/type info into ACMS when enabled in actor configs. ## Actual behavior - `LspToolAdapter._make_runtime_handler` (`src/cleveragents/lsp/tool_adapter.py`, lines 107-167) only implements diagnostics, completions, hover, and go-to-definition. Every other capability falls through to a `LspNotAvailableError`. For example, generating a handler for `LspCapability.RENAME` immediately raises `LspNotAvailableError` when invoked. - Actor compilation ignores the schema-provided `NodeLspBinding`: `NodeDefinition.lsp_binding` is parsed, but `_extract_lsp_bindings` in `src/cleveragents/actor/compiler.py` only looks for `node.config['lsp_bindings']`, so `CompilationMetadata.lsp_bindings` is empty. `LspRuntime.activate_bindings()` is never invoked, so no bindings are activated at runtime. - `LspContextEnrichment` is defined in `src/cleveragents/actor/schema.py` but unused elsewhere—there is no code that consumes the setting to push diagnostics/type annotations into ACMS. ## Steps to reproduce 1. Run: ```python from cleveragents.lsp.models import LspServerConfig, LspCapability from cleveragents.lsp.tool_adapter import LspToolAdapter from cleveragents.lsp.runtime import LspRuntime config = LspServerConfig(name='local/pyright', command='pyright-langserver', capabilities=[LspCapability.RENAME]) handler = LspToolAdapter(runtime=LspRuntime()).generate_tool_specs(config)[0]['handler'] handler(file_path='demo.py', line=1, column=1, new_name='foo') ``` The handler raises `LspNotAvailableError`, showing the capability is not implemented. 2. Compile an actor with `NodeLspBinding(server='local/pyright')` and inspect `CompilationMetadata.lsp_bindings`—the list is empty, so bindings are dropped. 3. Search the codebase for `lsp_context_enrichment`; it is defined but never used, so enabling it in actor YAML has no effect. ## Code location - `src/cleveragents/lsp/tool_adapter.py` - `src/cleveragents/actor/schema.py` - `src/cleveragents/actor/compiler.py` - `src/cleveragents/lsp/runtime.py`
HAL9000 self-assigned this 2026-04-10 06:21:48 +00:00
HAL9000 added this to the v3.5.0 milestone 2026-04-10 06:21:48 +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#6972
No description provided.