UAT: LSP Registry is in-memory only — agents lsp add registrations are lost between CLI invocations #5091

Open
opened 2026-04-09 00:59:58 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: LSP Registry / agents lsp commands
Severity: Critical
Discovered by: UAT Testing (uat-pool-1, worker: Provider Registry and LSP Integration)


What Was Tested

Tested the agents lsp add / agents lsp list / agents lsp show commands for persistence of registered LSP servers across CLI invocations.

Expected Behavior (from spec)

The spec states (§LSP Registry, line 20662):

Language servers are registered as first-class entities in the global LSP Registry, following the same patterns as the Tool Registry, Skill Registry, and Actor Registry.

And (§agents lsp, line 8643):

Manage the LSP Registry — the global registry of Language Server Protocol servers...

The registry is described as a persistent, global catalog. After agents lsp add --config pyright.yaml, subsequent calls to agents lsp list and agents lsp show local/pyright should return the registered server.

Actual Behavior

The LspRegistry is implemented as a pure in-memory data structure (dict[str, LspServerConfig]) with no persistence layer. Each CLI invocation creates a fresh Python process with an empty registry:

# src/cleveragents/cli/commands/lsp.py
_registry: LspRegistry | None = None

def _get_registry() -> LspRegistry:
    global _registry
    if _registry is None:
        _registry = LspRegistry()  # Always empty on new process
    return _registry

Reproduction:

$ agents lsp add --config pyright.yaml
╭─ LSP Server Registered ──────────────────────────────────╮
│ Name: local/pyright                                      │
│ ...                                                      │
╰──────────────────────────────────────────────────────────╯
OK LSP server registered

$ agents lsp list
No LSP servers found.
Register one with 'agents lsp add --config <file>'

$ agents lsp show local/pyright
Error: LSP server not found: local/pyright

The registration is lost immediately because the in-memory registry is discarded when the process exits.

Impact

  • All agents lsp commands are non-functional for any real use case — you cannot register a server and then use it
  • Actors cannot bind to LSP servers because the registry is always empty at runtime
  • The LSP Runtime cannot look up server configurations because the registry is always empty
  • This is a critical regression that makes the entire LSP subsystem unusable

Root Cause

LspRegistry (in src/cleveragents/lsp/registry.py) is a pure in-memory store with no database backend. The Tool Registry, Skill Registry, and Actor Registry all use the database (via Alembic-managed SQLite), but the LSP Registry was implemented as a stub without persistence.

Suggested Fix

Implement a database-backed LSP Registry following the same pattern as the Tool Registry:

  1. Add an lsp_servers table to the Alembic schema
  2. Implement LspRegistry with SQLAlchemy CRUD operations
  3. Wire the CLI commands to use the persistent registry via the DI container

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** LSP Registry / `agents lsp` commands **Severity:** Critical **Discovered by:** UAT Testing (uat-pool-1, worker: Provider Registry and LSP Integration) --- ## What Was Tested Tested the `agents lsp add` / `agents lsp list` / `agents lsp show` commands for persistence of registered LSP servers across CLI invocations. ## Expected Behavior (from spec) The spec states (§LSP Registry, line 20662): > Language servers are registered as first-class entities in the global **LSP Registry**, following the same patterns as the Tool Registry, Skill Registry, and Actor Registry. And (§agents lsp, line 8643): > Manage the **LSP Registry** — the global registry of Language Server Protocol servers... The registry is described as a persistent, global catalog. After `agents lsp add --config pyright.yaml`, subsequent calls to `agents lsp list` and `agents lsp show local/pyright` should return the registered server. ## Actual Behavior The `LspRegistry` is implemented as a pure in-memory data structure (`dict[str, LspServerConfig]`) with no persistence layer. Each CLI invocation creates a fresh Python process with an empty registry: ```python # src/cleveragents/cli/commands/lsp.py _registry: LspRegistry | None = None def _get_registry() -> LspRegistry: global _registry if _registry is None: _registry = LspRegistry() # Always empty on new process return _registry ``` **Reproduction:** ```bash $ agents lsp add --config pyright.yaml ╭─ LSP Server Registered ──────────────────────────────────╮ │ Name: local/pyright │ │ ... │ ╰──────────────────────────────────────────────────────────╯ OK LSP server registered $ agents lsp list No LSP servers found. Register one with 'agents lsp add --config <file>' $ agents lsp show local/pyright Error: LSP server not found: local/pyright ``` The registration is lost immediately because the in-memory registry is discarded when the process exits. ## Impact - **All `agents lsp` commands are non-functional** for any real use case — you cannot register a server and then use it - Actors cannot bind to LSP servers because the registry is always empty at runtime - The LSP Runtime cannot look up server configurations because the registry is always empty - This is a critical regression that makes the entire LSP subsystem unusable ## Root Cause `LspRegistry` (in `src/cleveragents/lsp/registry.py`) is a pure in-memory store with no database backend. The Tool Registry, Skill Registry, and Actor Registry all use the database (via Alembic-managed SQLite), but the LSP Registry was implemented as a stub without persistence. ## Suggested Fix Implement a database-backed LSP Registry following the same pattern as the Tool Registry: 1. Add an `lsp_servers` table to the Alembic schema 2. Implement `LspRegistry` with SQLAlchemy CRUD operations 3. Wire the CLI commands to use the persistent registry via the DI container --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:01:41 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — Spec compliance bug; deviates from documented behavior
  • Milestone: v3.2.0
  • Story Points: 3 — M
  • MoSCoW: Must Have — Spec compliance is required

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — Spec compliance bug; deviates from documented behavior - **Milestone**: v3.2.0 - **Story Points**: 3 — M - **MoSCoW**: Must Have — Spec compliance is required --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: 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.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5091
No description provided.