UAT: agents lsp add/list/remove/show --format json output missing spec-required nested data structure (lsp_server, lsp_servers, total, bound_actors keys) #6834

Open
opened 2026-04-10 02:41:19 +00:00 by HAL9000 · 0 comments
Owner

Background and Context

UAT code analysis of src/cleveragents/cli/commands/lsp.py against docs/specification.md §agents lsp reveals that all four primary LSP commands produce incorrect JSON output schemas when --format json is used.

Current Behavior

The add, list, remove, and show commands call format_output(_config_dict(server_config), fmt) without a command parameter and without wrapping the payload in the spec-required nested objects.

agents lsp add --format json produces:

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "name": "local/pyright",
    "command": "pyright-langserver",
    "languages": ["python"],
    ...
  }
}

agents lsp list --format json produces a flat list of config dicts — missing total, missing per-server bound_actors, missing filter sub-object when --language is applied.

Expected Behavior (from spec §8645, §8900)

agents lsp add --format json must produce:

{
  "command": "lsp add",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "lsp_server": {
      "name": "local/pyright",
      "languages": ["python"],
      "command": "pyright-langserver --stdio",
      "capabilities": ["diagnostics", "hover", ...]
    }
  },
  "timing": { "duration_ms": 12 },
  "messages": ["LSP server registered"]
}

agents lsp list --format json must produce:

{
  "command": "lsp list",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "lsp_servers": [
      {
        "name": "local/pyright",
        "languages": ["python"],
        "command": "pyright-langserver --stdio",
        "bound_actors": 3
      }
    ],
    "total": 3
  }
}

When --language filter is applied, data must also include "filter": {"language": "<LANG>"}.

Similarly, lsp show must wrap result as {"lsp_server": {...}} under data, and lsp remove must wrap as {"lsp_server_removed": {...}}.

Additionally, all commands omit the command string parameter when calling format_output(), causing the envelope "command" field to always be "".

Affected Code

  • src/cleveragents/cli/commands/lsp.py: add(), list_servers(), show(), remove() all pass flat _config_dict() output directly to format_output() without:
    1. Wrapping in spec-required nested keys (lsp_server, lsp_servers, etc.)
    2. Passing command="lsp add" (etc.) to populate the envelope command field
    3. Including total, bound_actors, or filter fields in list output

Steps to Reproduce

  1. Register an LSP server: agents lsp add --config <file>
  2. Run: agents lsp add --config <file> --format json
  3. Observe data is flat — missing lsp_server wrapper key, command field is empty string

Acceptance Criteria

  • agents lsp add --format json data contains lsp_server object with server fields
  • agents lsp list --format json data contains lsp_servers array with bound_actors per entry, plus total count
  • agents lsp list --language X --format json includes "filter": {"language": "X"} in data
  • agents lsp show --format json data contains lsp_server object
  • agents lsp remove --format json data contains lsp_server_removed object
  • All commands pass command="lsp <subcommand>" to format_output()

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

## Background and Context UAT code analysis of `src/cleveragents/cli/commands/lsp.py` against `docs/specification.md` §agents lsp reveals that all four primary LSP commands produce incorrect JSON output schemas when `--format json` is used. ## Current Behavior The `add`, `list`, `remove`, and `show` commands call `format_output(_config_dict(server_config), fmt)` without a `command` parameter and without wrapping the payload in the spec-required nested objects. **`agents lsp add --format json`** produces: ```json { "command": "", "status": "ok", "exit_code": 0, "data": { "name": "local/pyright", "command": "pyright-langserver", "languages": ["python"], ... } } ``` **`agents lsp list --format json`** produces a flat list of config dicts — missing `total`, missing per-server `bound_actors`, missing `filter` sub-object when `--language` is applied. ## Expected Behavior (from spec §8645, §8900) **`agents lsp add --format json`** must produce: ```json { "command": "lsp add", "status": "ok", "exit_code": 0, "data": { "lsp_server": { "name": "local/pyright", "languages": ["python"], "command": "pyright-langserver --stdio", "capabilities": ["diagnostics", "hover", ...] } }, "timing": { "duration_ms": 12 }, "messages": ["LSP server registered"] } ``` **`agents lsp list --format json`** must produce: ```json { "command": "lsp list", "status": "ok", "exit_code": 0, "data": { "lsp_servers": [ { "name": "local/pyright", "languages": ["python"], "command": "pyright-langserver --stdio", "bound_actors": 3 } ], "total": 3 } } ``` When `--language` filter is applied, `data` must also include `"filter": {"language": "<LANG>"}`. Similarly, `lsp show` must wrap result as `{"lsp_server": {...}}` under `data`, and `lsp remove` must wrap as `{"lsp_server_removed": {...}}`. Additionally, all commands omit the `command` string parameter when calling `format_output()`, causing the envelope `"command"` field to always be `""`. ## Affected Code - `src/cleveragents/cli/commands/lsp.py`: `add()`, `list_servers()`, `show()`, `remove()` all pass flat `_config_dict()` output directly to `format_output()` without: 1. Wrapping in spec-required nested keys (`lsp_server`, `lsp_servers`, etc.) 2. Passing `command="lsp add"` (etc.) to populate the envelope `command` field 3. Including `total`, `bound_actors`, or `filter` fields in list output ## Steps to Reproduce 1. Register an LSP server: `agents lsp add --config <file>` 2. Run: `agents lsp add --config <file> --format json` 3. Observe `data` is flat — missing `lsp_server` wrapper key, `command` field is empty string ## Acceptance Criteria - `agents lsp add --format json` `data` contains `lsp_server` object with server fields - `agents lsp list --format json` `data` contains `lsp_servers` array with `bound_actors` per entry, plus `total` count - `agents lsp list --language X --format json` includes `"filter": {"language": "X"}` in `data` - `agents lsp show --format json` `data` contains `lsp_server` object - `agents lsp remove --format json` `data` contains `lsp_server_removed` object - All commands pass `command="lsp <subcommand>"` to `format_output()` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-10 02:41:57 +00:00
HAL9000 self-assigned this 2026-04-10 06:07:49 +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#6834
No description provided.