UAT: agents actor context clear command is missing — spec requires it but it is not implemented #2848

Open
opened 2026-04-04 20:54:08 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/cli-actor-context-clear-command
  • Commit Message: fix(cli): implement missing agents actor context clear command
  • Milestone: v3.2.0
  • Parent Epic: #392

Background

The specification (docs/specification.md, line 288) defines the following CLI command:

agents actor context clear [--yes|-y] (--all|-a|<NAME>)

This command clears the persisted content (messages/history) of a named actor context, or all contexts, without deleting the context directory itself. This is semantically distinct from actor context remove, which deletes the context definition entirely (non-recoverable).

However, the implementation in src/cleveragents/cli/commands/actor_context.py only implements three commands:

  • context_remove (agents actor context remove)
  • context_export (agents actor context export)
  • context_import (agents actor context import)

The clear command is completely absent. The module docstring confirms this omission: "Implements agents actor context remove, agents actor context export, and agents actor context import per the v3 specification"clear is not mentioned.

Steps to Reproduce:

  1. Run agents actor context clear docs
  2. Expected: Clears the message history of the docs actor context
  3. Actual: Command not found error

Semantic distinction (spec-required):

  • remove — deletes the context directory entirely (non-recoverable)
  • clear — erases the cached/stored data within a context while preserving the context structure

Subtasks

  • Add context_clear function to src/cleveragents/cli/commands/actor_context.py
  • Implement --yes/-y confirmation flag (required for destructive action without flag)
  • Implement --all/-a flag to clear all actor contexts
  • Implement <NAME> positional argument to clear a single named context
  • Register the clear subcommand in the actor context CLI group
  • Update the module docstring to include agents actor context clear
  • Write Behave (Gherkin) unit test scenarios covering: clear by name, clear all, confirmation prompt, --yes bypass
  • Write Robot Framework integration test exercising the real agents actor context clear command
  • Ensure static typing on all new code passes nox -e typecheck (Pyright)
  • Verify nox -e coverage_report reports coverage ≥ 97%

Definition of Done

  • agents actor context clear <NAME> clears the content of the named actor context without deleting the context directory
  • agents actor context clear --all clears all actor contexts with confirmation
  • agents actor context clear --yes <NAME> skips the confirmation prompt
  • Running agents actor context clear docs no longer produces a "command not found" error
  • Module docstring in actor_context.py updated to reference the clear command
  • All Behave unit test scenarios pass (nox -e unit_tests)
  • All Robot Framework integration tests pass (nox -e integration_tests)
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/cli-actor-context-clear-command` - **Commit Message**: `fix(cli): implement missing agents actor context clear command` - **Milestone**: v3.2.0 - **Parent Epic**: #392 ## Background The specification (`docs/specification.md`, line 288) defines the following CLI command: ``` agents actor context clear [--yes|-y] (--all|-a|<NAME>) ``` This command clears the persisted content (messages/history) of a named actor context, or all contexts, **without deleting the context directory itself**. This is semantically distinct from `actor context remove`, which deletes the context definition entirely (non-recoverable). However, the implementation in `src/cleveragents/cli/commands/actor_context.py` only implements three commands: - `context_remove` (`agents actor context remove`) - `context_export` (`agents actor context export`) - `context_import` (`agents actor context import`) The `clear` command is completely absent. The module docstring confirms this omission: *"Implements `agents actor context remove`, `agents actor context export`, and `agents actor context import` per the v3 specification"* — `clear` is not mentioned. **Steps to Reproduce:** 1. Run `agents actor context clear docs` 2. **Expected:** Clears the message history of the `docs` actor context 3. **Actual:** Command not found error **Semantic distinction (spec-required):** - `remove` — deletes the context directory entirely (non-recoverable) - `clear` — erases the cached/stored data within a context while preserving the context structure ## Subtasks - [ ] Add `context_clear` function to `src/cleveragents/cli/commands/actor_context.py` - [ ] Implement `--yes`/`-y` confirmation flag (required for destructive action without flag) - [ ] Implement `--all`/`-a` flag to clear all actor contexts - [ ] Implement `<NAME>` positional argument to clear a single named context - [ ] Register the `clear` subcommand in the actor context CLI group - [ ] Update the module docstring to include `agents actor context clear` - [ ] Write Behave (Gherkin) unit test scenarios covering: clear by name, clear all, confirmation prompt, `--yes` bypass - [ ] Write Robot Framework integration test exercising the real `agents actor context clear` command - [ ] Ensure static typing on all new code passes `nox -e typecheck` (Pyright) - [ ] Verify `nox -e coverage_report` reports coverage ≥ 97% ## Definition of Done - [ ] `agents actor context clear <NAME>` clears the content of the named actor context without deleting the context directory - [ ] `agents actor context clear --all` clears all actor contexts with confirmation - [ ] `agents actor context clear --yes <NAME>` skips the confirmation prompt - [ ] Running `agents actor context clear docs` no longer produces a "command not found" error - [ ] Module docstring in `actor_context.py` updated to reference the `clear` command - [ ] All Behave unit test scenarios pass (`nox -e unit_tests`) - [ ] All Robot Framework integration tests pass (`nox -e integration_tests`) - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.2.0 milestone 2026-04-04 20:54:13 +00:00
freemo removed this from the v3.2.0 milestone 2026-04-06 22:28:48 +00:00
Author
Owner

This issue has been moved to the backlog as part of an aggressive grooming of the v3.2.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.

This issue has been moved to the backlog as part of an aggressive grooming of the v3.2.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.
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#2848
No description provided.