UAT: agents lsp remove does not warn about bound actors or terminate running LSP server processes #5101

Open
opened 2026-04-09 01:01:47 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

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


What Was Tested

Tested agents lsp remove against the spec for two behaviors:

  1. Warning about actors that reference the removed server
  2. Termination of running LSP server processes

Expected Behavior (from spec §agents lsp remove, line 8796)

The spec shows that agents lsp remove should:

  1. Display a "References" warning panel listing actors that reference the removed server:

    ╭─ References ──────────────────────────────────────────────────╮
    │ Warning: This LSP server is referenced by:                    │
    │ - Actor: local/code-reviewer (lsp: [local/pyright])           │
    │ - Actor: local/refactor-agent (lsp: [local/pyright])          │
    │ These actor LSP bindings will fail until resolved.            │
    ╰───────────────────────────────────────────────────────────────╯
    
  2. Terminate running LSP server processes bound to the removed entry (spec §agents lsp remove, line 8801):

    "Running LSP server processes bound to the removed entry are terminated."

  3. JSON output should include lsp_server_removed with referenced_actors and a warning message:

    {
      "messages": [
        "LSP server removed",
        "Warning: This LSP server is referenced by 2 actors. These actor LSP bindings will fail until resolved."
      ]
    }
    

Actual Behavior

The remove command in src/cleveragents/cli/commands/lsp.py (lines 195-237):

  1. No reference check — simply removes from the in-memory registry without checking which actors reference the server
  2. No process termination — no code to terminate running LSP server processes
  3. No warning panel — only shows a simple "LSP Server Removed" panel with the name
@app.command("remove")
def remove(name, yes, fmt):
    registry = _get_registry()
    config = registry.get(name)
    if config is None:
        console.print(f"[red]LSP server not found:[/red] {name}")
        raise typer.Abort()

    if not yes:
        confirm = typer.confirm(f"Remove LSP server {name}?", default=False)
        if not confirm:
            ...

    registry.remove(name)  # Just removes from dict, no reference check, no process termination

    console.print(Panel(f"[bold]Name:[/bold] {name}", title="LSP Server Removed", expand=False))
    console.print("[green]OK[/green] LSP server removed")

Impact

  • Operators removing an LSP server have no visibility into which actors will break
  • Running language server processes are not cleaned up, potentially leaving orphaned processes
  • The spec's safety warning about "actor LSP bindings will fail until resolved" is never shown

Suggested Fix

  1. Reference check: Before removing, query the Actor Registry for actors that have lsp: [name] in their configuration. Display a warning panel listing them.
  2. Process termination: Call LspRuntime.stop_server(name) (or equivalent) to terminate any running process for this server.
  3. JSON output: Include referenced_actors list and warning message in the JSON output.

Note: The reference check requires the Actor Registry to be queryable for LSP bindings, and process termination requires the LSP Runtime to be accessible from the CLI command. Both depend on the broader persistence and DI wiring work (see #5091).


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

## Bug Report **Feature Area:** LSP Registry / `agents lsp remove` **Severity:** Medium **Discovered by:** UAT Testing (uat-pool-1, worker: Provider Registry and LSP Integration) --- ## What Was Tested Tested `agents lsp remove` against the spec for two behaviors: 1. Warning about actors that reference the removed server 2. Termination of running LSP server processes ## Expected Behavior (from spec §agents lsp remove, line 8796) The spec shows that `agents lsp remove` should: 1. **Display a "References" warning panel** listing actors that reference the removed server: ``` ╭─ References ──────────────────────────────────────────────────╮ │ Warning: This LSP server is referenced by: │ │ - Actor: local/code-reviewer (lsp: [local/pyright]) │ │ - Actor: local/refactor-agent (lsp: [local/pyright]) │ │ These actor LSP bindings will fail until resolved. │ ╰───────────────────────────────────────────────────────────────╯ ``` 2. **Terminate running LSP server processes** bound to the removed entry (spec §agents lsp remove, line 8801): > "Running LSP server processes bound to the removed entry are terminated." 3. **JSON output** should include `lsp_server_removed` with `referenced_actors` and a warning message: ```json { "messages": [ "LSP server removed", "Warning: This LSP server is referenced by 2 actors. These actor LSP bindings will fail until resolved." ] } ``` ## Actual Behavior The `remove` command in `src/cleveragents/cli/commands/lsp.py` (lines 195-237): 1. **No reference check** — simply removes from the in-memory registry without checking which actors reference the server 2. **No process termination** — no code to terminate running LSP server processes 3. **No warning panel** — only shows a simple "LSP Server Removed" panel with the name ```python @app.command("remove") def remove(name, yes, fmt): registry = _get_registry() config = registry.get(name) if config is None: console.print(f"[red]LSP server not found:[/red] {name}") raise typer.Abort() if not yes: confirm = typer.confirm(f"Remove LSP server {name}?", default=False) if not confirm: ... registry.remove(name) # Just removes from dict, no reference check, no process termination console.print(Panel(f"[bold]Name:[/bold] {name}", title="LSP Server Removed", expand=False)) console.print("[green]OK[/green] LSP server removed") ``` ## Impact - Operators removing an LSP server have no visibility into which actors will break - Running language server processes are not cleaned up, potentially leaving orphaned processes - The spec's safety warning about "actor LSP bindings will fail until resolved" is never shown ## Suggested Fix 1. **Reference check**: Before removing, query the Actor Registry for actors that have `lsp: [name]` in their configuration. Display a warning panel listing them. 2. **Process termination**: Call `LspRuntime.stop_server(name)` (or equivalent) to terminate any running process for this server. 3. **JSON output**: Include `referenced_actors` list and warning message in the JSON output. Note: The reference check requires the Actor Registry to be queryable for LSP bindings, and process termination requires the LSP Runtime to be accessible from the CLI command. Both depend on the broader persistence and DI wiring work (see #5091). --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:11:02 +00:00
Author
Owner

Issue triaged by project owner: Verified as valid spec compliance bug. Priority: Medium. Milestone: v3.2.0.


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

Issue triaged by project owner: Verified as valid spec compliance bug. Priority: Medium. Milestone: v3.2.0. --- **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.

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