From c59a76cdb7107dc079fc9ae7f7b5e3691424fa2f Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman Date: Sun, 5 Apr 2026 09:03:15 +0000 Subject: [PATCH] fix(cli): add spec-required 'Profile Removed' panel to agents automation-profile remove rich output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The automation-profile remove command was only printing a plain checkmark message after deletion. The spec requires a Rich Panel titled 'Profile Removed' containing the profile name, followed by the success message. Changes: - Replace plain console.print checkmark with Panel render + success message - Panel displays 'Name: ' under 'Profile Removed' title - Success message updated to '✓ OK Profile removed' per spec - Behave feature: add panel assertions to existing remove scenario - Behave feature: add new 'Remove custom profile shows Profile Removed panel' scenario - Robot Framework helper: update test_remove_profile() to assert panel presence ISSUES CLOSED: #2966 --- features/automation_profile_cli.feature | 12 +++++++++++- robot/helper_automation_profile_cli.py | 13 +++++++++++-- src/cleveragents/cli/commands/automation_profile.py | 4 +++- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/features/automation_profile_cli.feature b/features/automation_profile_cli.feature index 653730f08..a28883860 100644 --- a/features/automation_profile_cli.feature +++ b/features/automation_profile_cli.feature @@ -167,7 +167,17 @@ Feature: Automation Profile CLI commands Given a custom profile "acme/strict" has been added When I run automation-profile remove "acme/strict" with --yes Then the automation-profile remove should succeed - And the automation-profile output should contain "removed" + And the automation-profile output should contain "Profile Removed" + And the automation-profile output should contain "Name:" + And the automation-profile output should contain "OK" + + Scenario: Remove custom profile shows Profile Removed panel + Given a custom profile "acme/panel-test" has been added + When I run automation-profile remove "acme/panel-test" with --yes + Then the automation-profile remove should succeed + And the automation-profile output should contain "Profile Removed" + And the automation-profile output should contain "acme/panel-test" + And the automation-profile output should contain "OK" Scenario: Remove built-in profile fails When I run automation-profile remove "manual" with --yes diff --git a/robot/helper_automation_profile_cli.py b/robot/helper_automation_profile_cli.py index d81077983..d1a71ebca 100644 --- a/robot/helper_automation_profile_cli.py +++ b/robot/helper_automation_profile_cli.py @@ -213,7 +213,7 @@ def test_list_json() -> None: def test_remove_profile() -> None: - """Test removing a custom profile.""" + """Test removing a custom profile - verifies Profile Removed panel is rendered.""" _reset_service() # First add a profile fd, path = tempfile.mkstemp(suffix=".yaml") @@ -228,7 +228,16 @@ def test_remove_profile() -> None: # Then remove it (reuse same service so the profile persists) result = _invoke(["remove", "acme/robot-test", "--yes"]) assert result.exit_code == 0, f"remove failed: {result.output}" - assert "removed" in result.output.lower() + # Verify the spec-required Profile Removed panel is rendered + assert "Profile Removed" in result.output, ( + f"Expected 'Profile Removed' panel in output. Got: {result.output}" + ) + assert "acme/robot-test" in result.output, ( + f"Expected profile name in panel output. Got: {result.output}" + ) + assert "OK" in result.output, ( + f"Expected 'OK' success message in output. Got: {result.output}" + ) print("remove-profile-ok") diff --git a/src/cleveragents/cli/commands/automation_profile.py b/src/cleveragents/cli/commands/automation_profile.py index 1c5baab8e..2fc2c99d6 100644 --- a/src/cleveragents/cli/commands/automation_profile.py +++ b/src/cleveragents/cli/commands/automation_profile.py @@ -308,7 +308,9 @@ def remove_profile( console.print(format_output(data, fmt)) return - console.print(f"[green]✓[/green] Automation profile removed: {name}") + panel = Panel(f"[bold cyan]Name:[/bold cyan] {name}", title="Profile Removed") + console.print(panel) + console.print("[green]✓ OK[/green] Profile removed") except NotFoundError as exc: console.print(f"[red]Profile not found:[/red] '{name}'") -- 2.52.0