UAT: agents actor context commands served by wrong module — context.py (file-based) overrides actor_context.py (named-context) in main.py registration #6480

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

Summary

agents actor context is supposed to expose the named-context management commands from actor_context.py (remove/export/import per spec). Instead, main.py registers context.py (the file-based context module) as the actor context sub-app, completely overriding the actor_context.py commands. The result is that agents actor context exposes file-management commands (add, load, remove PATHS..., list, show [PATH], export NAME FILE, import NAME FILE, delete, clear) instead of the spec-required named-context commands.

Spec Reference

docs/specification.md lines 283–288 and 5767–6353:

agents actor context remove [--yes|-y] (--all|-a|<NAME>)
agents actor context list [<REGEX>]
agents actor context show <NAME>
agents actor context export (--output|-o) <FILE> <NAME>
agents actor context import [--update] (--input|-i) <FILE> [<NAME>]
agents actor context clear [--yes|-y] (--all|-a|<NAME>)

Code Location

src/cleveragents/cli/main.py, lines 115–120:

# Register context as a sub-app of actor (canonical: agents actor context)
actor.app.add_typer(
    context.app,          # ← WRONG: this is context.py (file-based)
    name="context",
    help="Actor context management commands",
)

src/cleveragents/cli/commands/actor.py, line 966:

app.add_typer(actor_context_app, name="context")  # ← actor_context.py commands

Both registrations exist, but main.py registers context.py AFTER actor.py adds actor_context_app, so context.py wins and overrides the correct commands.

Steps to Reproduce

agents actor context --help
# Shows: add, load, remove PATHS..., list, show [PATH], export NAME FILE, import NAME FILE, delete, clear
# Expected: remove [--yes|-y] (--all|-a|<NAME>), list [REGEX], show <NAME>, export --output <FILE> <NAME>, import [--update] --input <FILE> [<NAME>], clear [--yes|-y] (--all|-a|<NAME>)

agents actor context remove --help
# Shows: "Remove files or directories from the current plan's context" with PATHS... argument
# Expected: "Remove a named actor context" with NAME argument and --all/-a, --yes/-y options

Expected vs Actual

Command Expected (spec) Actual
context remove [--yes|-y] (--all|-a|<NAME>) PATHS... (file paths)
context list [<REGEX>] no args, lists plan context files
context show <NAME> (context name) [PATH] (file path)
context export (--output|-o) <FILE> <NAME> NAME FILE (positional)
context import [--update] (--input|-i) <FILE> [<NAME>] NAME FILE (positional, no --update)
context clear [--yes|-y] (--all|-a|<NAME>) [NAME] (no --all flag)

Root Cause

main.py calls actor.app.add_typer(context.app, name="context") which registers the file-based context.py module. This overrides the actor_context_app that actor.py already registered at line 966. The fix is to remove the main.py registration of context.py under actor context, or ensure actor_context.py is registered last.

Impact

All agents actor context commands have wrong signatures and wrong semantics. Named-context management (the spec-required behavior) is completely inaccessible via agents actor context. The actor_context.py commands (remove/export/import) are registered but shadowed and unreachable.


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

## Summary `agents actor context` is supposed to expose the named-context management commands from `actor_context.py` (remove/export/import per spec). Instead, `main.py` registers `context.py` (the file-based context module) as the `actor context` sub-app, completely overriding the `actor_context.py` commands. The result is that `agents actor context` exposes file-management commands (`add`, `load`, `remove PATHS...`, `list`, `show [PATH]`, `export NAME FILE`, `import NAME FILE`, `delete`, `clear`) instead of the spec-required named-context commands. ## Spec Reference `docs/specification.md` lines 283–288 and 5767–6353: ``` agents actor context remove [--yes|-y] (--all|-a|<NAME>) agents actor context list [<REGEX>] agents actor context show <NAME> agents actor context export (--output|-o) <FILE> <NAME> agents actor context import [--update] (--input|-i) <FILE> [<NAME>] agents actor context clear [--yes|-y] (--all|-a|<NAME>) ``` ## Code Location `src/cleveragents/cli/main.py`, lines 115–120: ```python # Register context as a sub-app of actor (canonical: agents actor context) actor.app.add_typer( context.app, # ← WRONG: this is context.py (file-based) name="context", help="Actor context management commands", ) ``` `src/cleveragents/cli/commands/actor.py`, line 966: ```python app.add_typer(actor_context_app, name="context") # ← actor_context.py commands ``` Both registrations exist, but `main.py` registers `context.py` AFTER `actor.py` adds `actor_context_app`, so `context.py` wins and overrides the correct commands. ## Steps to Reproduce ```bash agents actor context --help # Shows: add, load, remove PATHS..., list, show [PATH], export NAME FILE, import NAME FILE, delete, clear # Expected: remove [--yes|-y] (--all|-a|<NAME>), list [REGEX], show <NAME>, export --output <FILE> <NAME>, import [--update] --input <FILE> [<NAME>], clear [--yes|-y] (--all|-a|<NAME>) agents actor context remove --help # Shows: "Remove files or directories from the current plan's context" with PATHS... argument # Expected: "Remove a named actor context" with NAME argument and --all/-a, --yes/-y options ``` ## Expected vs Actual | Command | Expected (spec) | Actual | |---|---|---| | `context remove` | `[--yes\|-y] (--all\|-a\|<NAME>)` | `PATHS...` (file paths) | | `context list` | `[<REGEX>]` | no args, lists plan context files | | `context show` | `<NAME>` (context name) | `[PATH]` (file path) | | `context export` | `(--output\|-o) <FILE> <NAME>` | `NAME FILE` (positional) | | `context import` | `[--update] (--input\|-i) <FILE> [<NAME>]` | `NAME FILE` (positional, no --update) | | `context clear` | `[--yes\|-y] (--all\|-a\|<NAME>)` | `[NAME]` (no --all flag) | ## Root Cause `main.py` calls `actor.app.add_typer(context.app, name="context")` which registers the file-based `context.py` module. This overrides the `actor_context_app` that `actor.py` already registered at line 966. The fix is to remove the `main.py` registration of `context.py` under `actor context`, or ensure `actor_context.py` is registered last. ## Impact All `agents actor context` commands have wrong signatures and wrong semantics. Named-context management (the spec-required behavior) is completely inaccessible via `agents actor context`. The `actor_context.py` commands (remove/export/import) are registered but shadowed and unreachable. --- **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#6480
No description provided.