From fc7e47f66bed6893f34c6db237bf9a79d19e8f0f Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Sun, 5 Apr 2026 08:38:26 +0000 Subject: [PATCH] fix(cli): remove --namespace/-n from agents plan list command Remove the --namespace/-n option from the agents plan list CLI command as it is not defined in the specification. The spec defines: agents plan list [--phase ] [--state ] [--project ] [--action ] [] Namespace filtering is already supported via the positional argument (e.g. 'agents plan list "^myteam/"'). Changes: - Remove namespace parameter from lifecycle_list_plans() function - Remove namespace=namespace from service.list_plans() call - Remove Namespace row from TUI Filters panel - Update docstring examples to remove --namespace references - Update filter panel condition to exclude namespace check - Remove 4 namespace-related scenarios from plan_cli_spec_alignment.feature - Remove corresponding step definitions from plan_cli_spec_alignment_steps.py ISSUES CLOSED: #2986 --- features/plan_cli_spec_alignment.feature | 25 ------------ .../steps/plan_cli_spec_alignment_steps.py | 38 ------------------- src/cleveragents/cli/commands/plan.py | 23 ++--------- 3 files changed, 4 insertions(+), 82 deletions(-) diff --git a/features/plan_cli_spec_alignment.feature b/features/plan_cli_spec_alignment.feature index 70260338..87bcde47 100644 --- a/features/plan_cli_spec_alignment.feature +++ b/features/plan_cli_spec_alignment.feature @@ -61,31 +61,6 @@ Feature: Plan CLI spec alignment And the plan spec use should pass argument "target_coverage" with value 80 # ---- plan list: filter combinations ---- - Scenario: Plan list with --namespace filter (long form) - Given plan spec alignment plans exist - When I run plan list with namespace "myteam" - Then the plan spec list should succeed - And the plan spec list should pass namespace "myteam" to service - - Scenario: Plan list with -n namespace filter (short form) - Given plan spec alignment plans exist - When I run plan list with short namespace "local" - Then the plan spec list should succeed - And the plan spec list should pass namespace "local" to service - - Scenario: Plan list with --namespace shows Namespace in Filters panel - Given plan spec alignment plans exist - When I run plan list with namespace "myteam" - Then the plan spec list should succeed - And the plan spec list output should contain "Namespace" - And the plan spec list output should contain "myteam" - - Scenario: Plan list with --namespace combined with --state - Given plan spec alignment plans exist - When I run plan list filtering by namespace "myteam" and processing state "queued" - Then the plan spec list should succeed - And the plan spec list should pass namespace "myteam" to service - Scenario: Plan list with --phase filter Given plan spec alignment plans exist When I run plan list with phase "strategize" diff --git a/features/steps/plan_cli_spec_alignment_steps.py b/features/steps/plan_cli_spec_alignment_steps.py index 5ada0411..f958f396 100644 --- a/features/steps/plan_cli_spec_alignment_steps.py +++ b/features/steps/plan_cli_spec_alignment_steps.py @@ -280,30 +280,6 @@ def step_plan_use_arg(context: Context, arg_str: str) -> None: # --------------------------------------------------------------------------- -@when('I run plan list with namespace "{namespace}"') -def step_plan_list_namespace(context: Context, namespace: str) -> None: - """Run list with --namespace filter (long form).""" - context.result = context.runner.invoke(plan_app, ["list", "--namespace", namespace]) - - -@when('I run plan list with short namespace "{namespace}"') -def step_plan_list_short_namespace(context: Context, namespace: str) -> None: - """Run list with -n namespace filter (short form).""" - context.result = context.runner.invoke(plan_app, ["list", "-n", namespace]) - - -@when( - 'I run plan list filtering by namespace "{namespace}" and processing state "{state}"' -) -def step_plan_list_namespace_and_state( - context: Context, namespace: str, state: str -) -> None: - """Run list with --namespace and --state combined.""" - context.result = context.runner.invoke( - plan_app, ["list", "--namespace", namespace, "--state", state] - ) - - @when('I run plan list with phase "{phase}"') def step_plan_list_phase(context: Context, phase: str) -> None: """Run list with --phase filter.""" @@ -440,20 +416,6 @@ def step_plan_list_ok(context: Context) -> None: ) -@then('the plan spec list should pass namespace "{namespace}" to service') -def step_plan_list_namespace_passed(context: Context, namespace: str) -> None: - """Verify the namespace was passed to list_plans service call.""" - call_kwargs = context.mock_service.list_plans.call_args - assert call_kwargs is not None, "list_plans was not called" - # Support both positional and keyword argument styles - kwargs = call_kwargs[1] if call_kwargs[1] else {} - args = call_kwargs[0] if call_kwargs[0] else () - passed_namespace = kwargs.get("namespace", args[0] if args else None) - assert passed_namespace == namespace, ( - f"Expected namespace='{namespace}', got namespace='{passed_namespace}'" - ) - - @then('the plan spec list output should contain "{text}"') def step_plan_list_output_contains(context: Context, text: str) -> None: """Verify the list output contains expected text (case-insensitive).""" diff --git a/src/cleveragents/cli/commands/plan.py b/src/cleveragents/cli/commands/plan.py index db8f7d3f..e6e5f8d9 100644 --- a/src/cleveragents/cli/commands/plan.py +++ b/src/cleveragents/cli/commands/plan.py @@ -2311,14 +2311,6 @@ def lifecycle_list_plans( help="Optional regex pattern to filter plan names", ), ] = None, - namespace: Annotated[ - str | None, - typer.Option( - "--namespace", - "-n", - help="Filter plans by namespace", - ), - ] = None, phase: Annotated[ str | None, typer.Option( @@ -2374,9 +2366,9 @@ def lifecycle_list_plans( Examples: agents plan list - agents plan list --namespace myteam - agents plan list -n myteam --state processing agents plan list --phase strategize + agents plan list --state processing + agents plan list "^myteam/" """ try: import re @@ -2413,9 +2405,7 @@ def lifecycle_list_plans( ) raise typer.Abort() from exc - plans = service.list_plans( - namespace=namespace, phase=phase_filter, project_name=project_id - ) + plans = service.list_plans(phase=phase_filter, project_name=project_id) # Apply processing state filter if state_filter: @@ -2502,11 +2492,6 @@ def lifecycle_list_plans( # Display Filters panel (only if any filter is active) active_filters = [] - if namespace: - active_filters.append(f"[yellow]Namespace:[/yellow] {namespace}") - else: - active_filters.append("[yellow]Namespace:[/yellow] (any)") - if phase_filter: active_filters.append(f"[yellow]Phase:[/yellow] {phase_filter}") else: @@ -2528,7 +2513,7 @@ def lifecycle_list_plans( active_filters.append("[yellow]Action:[/yellow] (any)") # Only show Filters panel if at least one filter is active - if namespace or phase_filter or state_filter or project_id or action_filter: + if phase_filter or state_filter or project_id or action_filter: filters_text = "\n".join(active_filters) filters_panel = Panel(filters_text, title="Filters", border_style="dim") console.print(filters_panel)