feat: add server control commands (disable, enable, destroy)

Add /lsp-servers, /lsp-disable, /lsp-enable, and /lsp-destroy TUI commands.
Disabled servers are tracked in-memory per-extension-instance; the shared
daemon is never mutated by disable/enable. When all servers are disabled,
LSP tools are removed from the active tool set so the LLM won't attempt them.

Also adds a destroy_server daemon operation that kills running LspClient
entries by server ID or all entries.
This commit is contained in:
2026-04-30 09:48:01 -04:00
parent 7abe4efa02
commit e131e0e8cd
5 changed files with 237 additions and 3 deletions

View File

@@ -30,6 +30,26 @@ Run diagnostics manually on specific files:
/lsp-check main.go utils.go
```
### Server Control Commands
Disable a server so this pi instance won't use it (the shared daemon and other instances are unaffected). When all servers are disabled, LSP tools are removed from the active tool set.
| Command | Args | Behavior |
|---------|------|----------|
| `/lsp-servers` | none | List running servers and disabled state |
| `/lsp-disable` | `[<id>]` | Disable all (no arg) or specific server. Bare command disables all. |
| `/lsp-enable` | `[<id>]` | Enable all (no arg) or specific server. Restores tools when any is enabled. |
| `/lsp-destroy` | `[<id>]` | Kill running daemon entries for all (no arg) or specific server. Explicitly destructive. |
```bash
/lsp-disable gopls # Disable just gopls; other LSP tools still work
/lsp-disable # Disable all — removes LSP tools from active set
/lsp-enable gopls # Re-enable gopls; restores tools
/lsp-enable # Re-enable all
/lsp-destroy gopls # Kill running gopls process(es) in the daemon
/lsp-destroy # Kill all running server processes
```
## Install
```bash