UAT: agents lsp remove does not terminate running LSP server processes as specified #3528

Open
opened 2026-04-05 18:58:05 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: fix/lsp-remove-terminate-running-processes
  • Commit Message: fix(cli): terminate running LSP server processes in agents lsp remove
  • 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.

What Was Tested

Code-level analysis of src/cleveragents/cli/commands/lsp.py — specifically the remove() command implementation.

Expected Behavior (from spec)

Per docs/specification.md (agents lsp remove section, marked as "Destructive Operation"):

Remove a registered LSP server from the LSP Registry. Running LSP server processes bound to the removed entry are terminated. Actor configurations referencing this server by name will fail at activation until resolved.

When an LSP server is removed from the registry, any running processes for that server should be terminated before the registry entry is deleted.

Actual Behavior (from code)

The remove() command at lines 196–237 of lsp.py only calls registry.remove(name) — it removes the configuration from the in-memory registry but does NOT:

  1. Check if any LSP server processes are currently running for this server
  2. Terminate any running processes via LspRuntime or LspLifecycleManager

The CLI remove command has no reference to LspRuntime or LspLifecycleManager at all. Running server processes will continue running even after the registry entry is removed, leaving orphaned processes with no way to manage them.

Code Location

  • src/cleveragents/cli/commands/lsp.py, lines 196–237: remove() command implementation
  • Missing: integration with LspRuntime.stop_server() or LspLifecycleManager.stop_server()

Steps to Reproduce

  1. Register an LSP server: agents lsp add --config pyright.yaml
  2. Start the server (e.g., via actor activation)
  3. Run agents lsp remove local/pyright --yes
  4. Observe that the server process continues running (not terminated)

Subtasks

  • Wire agents lsp remove to call LspRuntime.stop_server() (or equivalent) for any running processes before removing from registry
  • Handle the case where no runtime is available (graceful degradation — log a warning, do not abort the removal)
  • Update unit tests in features/lsp_cli_new_coverage.feature to assert process termination occurs on remove
  • 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.
  • agents lsp remove terminates any running LSP server processes before removing the registry entry, matching the spec's "Destructive Operation" guarantee.
  • 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-remove-terminate-running-processes` - **Commit Message**: `fix(cli): terminate running LSP server processes in agents lsp remove` - **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. ## What Was Tested Code-level analysis of `src/cleveragents/cli/commands/lsp.py` — specifically the `remove()` command implementation. ## Expected Behavior (from spec) Per `docs/specification.md` (agents lsp remove section, marked as "Destructive Operation"): > Remove a registered LSP server from the LSP Registry. **Running LSP server processes bound to the removed entry are terminated.** Actor configurations referencing this server by name will fail at activation until resolved. When an LSP server is removed from the registry, any running processes for that server should be terminated before the registry entry is deleted. ## Actual Behavior (from code) The `remove()` command at lines 196–237 of `lsp.py` only calls `registry.remove(name)` — it removes the configuration from the in-memory registry but does NOT: 1. Check if any LSP server processes are currently running for this server 2. Terminate any running processes via `LspRuntime` or `LspLifecycleManager` The CLI `remove` command has no reference to `LspRuntime` or `LspLifecycleManager` at all. Running server processes will continue running even after the registry entry is removed, leaving orphaned processes with no way to manage them. ## Code Location - `src/cleveragents/cli/commands/lsp.py`, lines 196–237: `remove()` command implementation - Missing: integration with `LspRuntime.stop_server()` or `LspLifecycleManager.stop_server()` ## Steps to Reproduce 1. Register an LSP server: `agents lsp add --config pyright.yaml` 2. Start the server (e.g., via actor activation) 3. Run `agents lsp remove local/pyright --yes` 4. Observe that the server process continues running (not terminated) ## Subtasks - [ ] Wire `agents lsp remove` to call `LspRuntime.stop_server()` (or equivalent) for any running processes before removing from registry - [ ] Handle the case where no runtime is available (graceful degradation — log a warning, do not abort the removal) - [ ] Update unit tests in `features/lsp_cli_new_coverage.feature` to assert process termination occurs on remove - [ ] 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. - `agents lsp remove` terminates any running LSP server processes before removing the registry entry, matching the spec's "Destructive Operation" guarantee. - 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
freemo added this to the v3.6.0 milestone 2026-04-05 20:05:37 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — agents lsp remove does not terminate running LSP server processes, leaving orphaned processes. The spec explicitly marks this as a "Destructive Operation" that must terminate running processes.
  • Milestone: v3.6.0
  • Story Points: 3 — M — Requires wiring the CLI to LspRuntime.stop_server(), handling graceful degradation, and updating tests.
  • MoSCoW: Should Have — The spec explicitly requires process termination on remove. Orphaned processes are a resource leak and operational hazard. Important for production readiness.
  • Parent Epic: #824 (dependency link already exists)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — `agents lsp remove` does not terminate running LSP server processes, leaving orphaned processes. The spec explicitly marks this as a "Destructive Operation" that must terminate running processes. - **Milestone**: v3.6.0 - **Story Points**: 3 — M — Requires wiring the CLI to `LspRuntime.stop_server()`, handling graceful degradation, and updating tests. - **MoSCoW**: Should Have — The spec explicitly requires process termination on remove. Orphaned processes are a resource leak and operational hazard. Important for production readiness. - **Parent Epic**: #824 (dependency link already exists) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Milestone Triage Decision: Moved to Backlog (Defer to M8)

This TUI-adjacent feature has been moved out of v3.6.0 during aggressive milestone triage. LSP process management for TUI belongs in M8 (v3.7.0), not in Advanced Concepts milestone.

Reasoning:

  • v3.6.0 focus: Advanced concepts that extend beyond core MVP but do NOT require TUI or Server
  • This issue: LSP process termination for TUI - TUI-adjacent feature
  • Impact: User interface tooling, not advanced conceptual capability

Will be addressed in M8 (v3.7.0) TUI milestone when LSP integration is needed for TUI workflows.

**Milestone Triage Decision: Moved to Backlog (Defer to M8)** This TUI-adjacent feature has been moved out of v3.6.0 during aggressive milestone triage. LSP process management for TUI belongs in M8 (v3.7.0), not in Advanced Concepts milestone. **Reasoning:** - v3.6.0 focus: Advanced concepts that extend beyond core MVP but do NOT require TUI or Server - This issue: LSP process termination for TUI - TUI-adjacent feature - Impact: User interface tooling, not advanced conceptual capability Will be addressed in M8 (v3.7.0) TUI milestone when LSP integration is needed for TUI workflows.
freemo removed this from the v3.6.0 milestone 2026-04-06 23:43:25 +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#3528
No description provided.