UAT: agents actor remove missing --format flag — spec requires JSON/YAML/plain output support #3405

Open
opened 2026-04-05 16:31:05 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: bugfix/m5-actor-remove-format-flag
  • Commit Message: fix(cli): add --format flag to actor remove command
  • Milestone: v3.4.0
  • Parent Epic: #392

Background and context

The agents actor remove command is missing the --format flag that the specification explicitly requires. All sibling actor commands (actor add, actor list, actor show, actor update) already accept --format with JSON/YAML/plain output support. The remove subcommand was implemented without this flag, leaving it non-compliant with the spec's output envelope contract.

The specification documents the full JSON envelope structure for actor remove, including actor metadata, impact assessment, and cleanup details. Without --format, the command always emits Rich panels regardless of the caller's format preference, making it impossible to use in scripted or machine-readable workflows.

Current behavior

Running agents actor remove <name> --format json fails immediately:

Error: No such option: --format

The remove() function in src/cleveragents/cli/commands/actor.py (line 657) has no fmt parameter and no --format option. It always outputs Rich panels. Contrast with actor add, actor list, actor show, and actor update, which all accept --format.

Expected behavior

Per the specification, agents actor remove local/reviewer --format json should output:

{
  "command": "agents actor remove local/reviewer",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "actor_removed": {
      "name": "local/reviewer",
      "provider": "openai",
      "model": "gpt-4"
    },
    "impact": {
      "sessions": 0,
      "active_plans": 0,
      "actions_referencing": 0
    },
    "cleanup": {
      "config": "kept on disk",
      "contexts": "1 orphaned"
    }
  },
  "timing": { "duration_ms": 65 },
  "messages": [{ "level": "ok", "text": "Actor removed" }]
}

Similarly, --format yaml and --format plain must produce spec-compliant output in their respective formats.

Acceptance criteria

  • agents actor remove <name> --format json outputs valid JSON matching the spec envelope
  • agents actor remove <name> --format yaml outputs valid YAML
  • agents actor remove <name> --format plain outputs plain text
  • Default behaviour (no --format) continues to render Rich panels (no regression)
  • All nox stages pass; coverage ≥ 97%

Supporting information

  • Code location: src/cleveragents/cli/commands/actor.py, line 657 — def remove(name: ...) — missing fmt parameter and --format option
  • Steps to reproduce:
    1. Run agents actor remove <name> --format json
    2. Observe: Error: No such option: --format
  • Sibling commands for reference: actor add, actor list, actor show, actor update all implement fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = "rich" and call format_output(data, fmt) when fmt != "rich"

Subtasks

  • Add fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = "rich" parameter to remove() command in actor.py
  • Add format-conditional output: when fmt != "rich", call format_output(data, fmt) with actor data dict matching the spec envelope
  • Add BDD Behave unit tests for actor remove --format json, --format yaml, and --format plain
  • Verify nox -e typecheck passes (strict Pyright, no # type: ignore)
  • Verify coverage ≥ 97% (nox -e coverage_report)

Definition of Done

  • agents actor remove <name> --format json outputs valid JSON matching the spec envelope structure
  • agents actor remove <name> --format yaml outputs valid YAML
  • agents actor remove <name> --format plain outputs plain text
  • Default Rich panel output is preserved (no regression)
  • All nox stages pass (nox -e lint, nox -e typecheck, nox -e unit_tests, nox -e integration_tests, nox -e coverage_report)
  • Coverage >= 97%
  • Associated PR is merged and linked

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

## Metadata - **Branch**: `bugfix/m5-actor-remove-format-flag` - **Commit Message**: `fix(cli): add --format flag to actor remove command` - **Milestone**: v3.4.0 - **Parent Epic**: #392 ## Background and context The `agents actor remove` command is missing the `--format` flag that the specification explicitly requires. All sibling actor commands (`actor add`, `actor list`, `actor show`, `actor update`) already accept `--format` with JSON/YAML/plain output support. The `remove` subcommand was implemented without this flag, leaving it non-compliant with the spec's output envelope contract. The specification documents the full JSON envelope structure for `actor remove`, including actor metadata, impact assessment, and cleanup details. Without `--format`, the command always emits Rich panels regardless of the caller's format preference, making it impossible to use in scripted or machine-readable workflows. ## Current behavior Running `agents actor remove <name> --format json` fails immediately: ``` Error: No such option: --format ``` The `remove()` function in `src/cleveragents/cli/commands/actor.py` (line 657) has no `fmt` parameter and no `--format` option. It always outputs Rich panels. Contrast with `actor add`, `actor list`, `actor show`, and `actor update`, which all accept `--format`. ## Expected behavior Per the specification, `agents actor remove local/reviewer --format json` should output: ```json { "command": "agents actor remove local/reviewer", "status": "ok", "exit_code": 0, "data": { "actor_removed": { "name": "local/reviewer", "provider": "openai", "model": "gpt-4" }, "impact": { "sessions": 0, "active_plans": 0, "actions_referencing": 0 }, "cleanup": { "config": "kept on disk", "contexts": "1 orphaned" } }, "timing": { "duration_ms": 65 }, "messages": [{ "level": "ok", "text": "Actor removed" }] } ``` Similarly, `--format yaml` and `--format plain` must produce spec-compliant output in their respective formats. ## Acceptance criteria - `agents actor remove <name> --format json` outputs valid JSON matching the spec envelope - `agents actor remove <name> --format yaml` outputs valid YAML - `agents actor remove <name> --format plain` outputs plain text - Default behaviour (no `--format`) continues to render Rich panels (no regression) - All nox stages pass; coverage ≥ 97% ## Supporting information - **Code location**: `src/cleveragents/cli/commands/actor.py`, line 657 — `def remove(name: ...)` — missing `fmt` parameter and `--format` option - **Steps to reproduce**: 1. Run `agents actor remove <name> --format json` 2. Observe: `Error: No such option: --format` - **Sibling commands for reference**: `actor add`, `actor list`, `actor show`, `actor update` all implement `fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = "rich"` and call `format_output(data, fmt)` when `fmt != "rich"` ## Subtasks - [ ] Add `fmt: Annotated[str, typer.Option("--format", "-f", help=_FORMAT_HELP)] = "rich"` parameter to `remove()` command in `actor.py` - [ ] Add format-conditional output: when `fmt != "rich"`, call `format_output(data, fmt)` with actor data dict matching the spec envelope - [ ] Add BDD Behave unit tests for `actor remove --format json`, `--format yaml`, and `--format plain` - [ ] Verify `nox -e typecheck` passes (strict Pyright, no `# type: ignore`) - [ ] Verify coverage ≥ 97% (`nox -e coverage_report`) ## Definition of Done - [ ] `agents actor remove <name> --format json` outputs valid JSON matching the spec envelope structure - [ ] `agents actor remove <name> --format yaml` outputs valid YAML - [ ] `agents actor remove <name> --format plain` outputs plain text - [ ] Default Rich panel output is preserved (no regression) - [ ] All nox stages pass (`nox -e lint`, `nox -e typecheck`, `nox -e unit_tests`, `nox -e integration_tests`, `nox -e coverage_report`) - [ ] Coverage >= 97% - [ ] Associated PR is merged and linked --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.4.0 milestone 2026-04-05 16:31:20 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Critical — The specification requires JSON/YAML/plain output support for all CLI commands. Missing --format flag on agents actor remove is a spec violation.
  • Milestone: v3.4.0 (already set)
  • Story Points: 2 — S — Add --format flag following the existing pattern from other CLI commands. Estimated 1-4 hours.
  • MoSCoW: Should Have — While spec-required, the command still functions without the flag. Not blocking core functionality.
  • Parent Epic: #392 (Actor YAML & Compiler)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Critical — The specification requires JSON/YAML/plain output support for all CLI commands. Missing `--format` flag on `agents actor remove` is a spec violation. - **Milestone**: v3.4.0 (already set) - **Story Points**: 2 — S — Add `--format` flag following the existing pattern from other CLI commands. Estimated 1-4 hours. - **MoSCoW**: Should Have — While spec-required, the command still functions without the flag. Not blocking core functionality. - **Parent Epic**: #392 (Actor YAML & Compiler) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Milestone Triage Decision: Moved to Backlog (Belongs in Earlier Milestone)

This CLI formatting issue has been moved out of v3.4.0 during aggressive milestone triage. CLI formatting belongs in earlier milestones, not in ACMS v1 + Context Scaling.

Reasoning:

  • v3.4.0 focus: ACMS v1 implementation and Context Scaling capabilities
  • This issue: CLI formatting (agents actor remove --format) - basic CLI functionality
  • Impact: CLI polish, not ACMS or context scaling capability

Should be addressed in v3.2.0 alongside actor management core functionality.

**Milestone Triage Decision: Moved to Backlog (Belongs in Earlier Milestone)** This CLI formatting issue has been moved out of v3.4.0 during aggressive milestone triage. CLI formatting belongs in earlier milestones, not in ACMS v1 + Context Scaling. **Reasoning:** - v3.4.0 focus: ACMS v1 implementation and Context Scaling capabilities - This issue: CLI formatting (`agents actor remove --format`) - basic CLI functionality - Impact: CLI polish, not ACMS or context scaling capability Should be addressed in v3.2.0 alongside actor management core functionality.
freemo removed this from the v3.4.0 milestone 2026-04-06 21:04:14 +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
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3405
No description provided.