UAT: agents actor context remove removes entire context directories instead of individual keys per spec #6309

Open
opened 2026-04-09 20:08:49 +00:00 by HAL9000 · 0 comments
Owner

Summary

The spec defines agents actor context remove <ACTOR> <KEY> to remove a specific key from an actor's context store. The implementation treats context remove as removing an entire named context directory (taking a single <NAME> argument, not <ACTOR> <KEY>). The semantics are completely different: the spec is key-level deletion, the implementation is context-level deletion.

Spec Reference

docs/specification.md — Actor Context Commands:

agents actor context remove <ACTOR> <KEY>
  • Removes the named key <KEY> from the context associated with actor <ACTOR>

Code Location

src/cleveragents/cli/commands/actor_context.py, lines 99–231

@app.command("remove")
def context_remove(
    name: Annotated[
        str | None,
        typer.Argument(help="Context name to remove"),   # Single arg: whole-context name
    ] = None,
    all_contexts: Annotated[
        bool,
        typer.Option("--all", "-a", help="Remove all contexts"),
    ] = False,
    ...
) -> None:
    """Remove a named actor context or all actor contexts."""
    # Lines 162-163: removes shutil.rmtree(base / cname) — entire directory
    # Lines 204: ctx_mgr.delete() — deletes entire context

The implementation:

  1. Takes a single <NAME> argument (a context name) — not <ACTOR> + <KEY>
  2. Calls shutil.rmtree() to delete the entire context directory (line 163) or ctx_mgr.delete() (line 204)
  3. Has an --all option to wipe all contexts (this is closer to clear from the spec)

Steps to Reproduce

# Spec-compliant usage to remove a single key
agents actor context remove local/my-actor session_state
# Actual: interprets "local/my-actor" as the context name, tries to remove the whole context for it
# "session_state" is treated as an extra unrecognised argument (or causes an error)

Expected vs Actual

Expected Actual
Arguments <ACTOR> <KEY> (two positional) [NAME] (one optional positional)
Operation Remove one key from actor's context map Delete entire named context directory
--all flag Not in spec Present (effectively duplicates spec's clear)

Impact

Users cannot remove individual context keys for an actor. The --all flag behaviour duplicates the spec's clear command. The spec-defined remove <ACTOR> <KEY> functionality is not implemented.


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

## Summary The spec defines `agents actor context remove <ACTOR> <KEY>` to remove a **specific key** from an actor's context store. The implementation treats `context remove` as removing an **entire named context directory** (taking a single `<NAME>` argument, not `<ACTOR> <KEY>`). The semantics are completely different: the spec is key-level deletion, the implementation is context-level deletion. ## Spec Reference `docs/specification.md` — Actor Context Commands: ``` agents actor context remove <ACTOR> <KEY> ``` - Removes the named key `<KEY>` from the context associated with actor `<ACTOR>` ## Code Location `src/cleveragents/cli/commands/actor_context.py`, lines 99–231 ```python @app.command("remove") def context_remove( name: Annotated[ str | None, typer.Argument(help="Context name to remove"), # Single arg: whole-context name ] = None, all_contexts: Annotated[ bool, typer.Option("--all", "-a", help="Remove all contexts"), ] = False, ... ) -> None: """Remove a named actor context or all actor contexts.""" # Lines 162-163: removes shutil.rmtree(base / cname) — entire directory # Lines 204: ctx_mgr.delete() — deletes entire context ``` The implementation: 1. Takes a single `<NAME>` argument (a context name) — not `<ACTOR>` + `<KEY>` 2. Calls `shutil.rmtree()` to delete the entire context directory (line 163) or `ctx_mgr.delete()` (line 204) 3. Has an `--all` option to wipe all contexts (this is closer to `clear` from the spec) ## Steps to Reproduce ```bash # Spec-compliant usage to remove a single key agents actor context remove local/my-actor session_state # Actual: interprets "local/my-actor" as the context name, tries to remove the whole context for it # "session_state" is treated as an extra unrecognised argument (or causes an error) ``` ## Expected vs Actual | | Expected | Actual | |---|---|---| | Arguments | `<ACTOR> <KEY>` (two positional) | `[NAME]` (one optional positional) | | Operation | Remove one key from actor's context map | Delete entire named context directory | | `--all` flag | Not in spec | Present (effectively duplicates spec's `clear`) | ## Impact Users cannot remove individual context keys for an actor. The `--all` flag behaviour duplicates the spec's `clear` command. The spec-defined `remove <ACTOR> <KEY>` functionality is not implemented. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
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#6309
No description provided.