UAT: agents plan execute rich output shows generic plan details panel instead of spec-required Execution/Sandbox/Strategy Summary/Progress panels #4737

Open
opened 2026-04-08 18:13:35 +00:00 by HAL9000 · 2 comments
Owner

Bug Report

Feature Area: Plan execution and apply phase
Command: agents plan execute <PLAN_ID> (rich/default output)

What Was Tested

The rich (default) output format of agents plan execute.

Expected Behavior (from spec §agents plan execute)

The spec defines four distinct Rich panels for agents plan execute:

$ agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J

╭─ Execution ──────────────────────╮
│ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
│ Phase: execute                   │
│ Sandbox: git_worktree            │
│ Worker: local/executor           │
│ Started: 12:58:10                │
│ Attempt: 1                       │
╰──────────────────────────────────╯

╭─ Sandbox ──────────────────────────────────╮
│ Strategy: git_worktree                     │
│ Path: /repos/api/.worktrees/plan-01HXM8    │
│ Branch: cleveragents/plan-01HXM8C2         │
│ Status: active                             │
╰────────────────────────────────────────────╯

╭─ Strategy Summary ─────────────────────╮
│ Decisions: 8                           │
│ Invariants: 2                          │
│ Planned Child Plans: 2+                │
│ Estimated Files: ~12                   │
│ Risk: low                              │
╰────────────────────────────────────────╯

╭─ Progress ─────────╮
│ ⏳ Collect context │
│ • Run tools        │
│ • Build changeset  │
│ • Validate         │
╰────────────────────╯

✓ OK Execution started

Actual Behavior (from code analysis)

File: src/cleveragents/cli/commands/plan.py, lines 2118–2133

if fmt != OutputFormat.RICH.value:
    ...
else:
    _print_lifecycle_plan(plan, title="Plan Executed")  # BUG: shows generic plan details
    phase_label = f"{plan.phase.value}/{plan.state.value}"
    if plan.phase == PlanPhase.EXECUTE and plan.state in (
        ProcessingState.COMPLETE,
        ProcessingState.APPLIED,
    ):
        console.print(
            f"\n[dim]Plan execution completed ({phase_label}). "
            "Run 'agents plan apply <id>' when ready.[/dim]"
        )
    else:
        console.print(
            f"\n[dim]Plan is now in {phase_label} state. "
            "Run 'agents plan execute <id>' to continue.[/dim]"
        )

The code calls _print_lifecycle_plan(plan, title="Plan Executed") which renders a generic plan details panel showing fields like ID, Name, Action, Phase, Processing State, Projects, Description, Strategy Actor, Execution Actor, etc.

This is not the spec-required output. The spec requires:

  1. "Execution" panel — Plan ID, Phase, Sandbox strategy, Worker, Started time, Attempt number
  2. "Sandbox" panel — Strategy, Path, Branch, Status
  3. "Strategy Summary" panel — Decisions count, Invariants count, Planned Child Plans, Estimated Files, Risk
  4. "Progress" panel — 4 steps (Collect context, Run tools, Build changeset, Validate) with status indicators
  5. ✓ OK Execution started footer line

The current output is a generic plan state dump, not the execution-specific view the spec defines.

Code Location

  • src/cleveragents/cli/commands/plan.py:
    • execute_plan() function, lines 2118–2133 (rich output branch)

Steps to Reproduce

agents plan use local/some-action my-project
agents plan execute <PLAN_ID>
# Observe: generic plan details panel instead of Execution/Sandbox/Progress panels

Impact

The primary user-facing output of agents plan execute does not match the spec. Users see a generic plan state dump instead of the execution-focused view with sandbox details, strategy summary, and progress steps. This is the most visible output of the core plan execution workflow.

Fix Suggestion

Replace the _print_lifecycle_plan(plan, title="Plan Executed") call with a dedicated _print_execute_output(plan) function that renders the four spec-required panels:

def _print_execute_output(plan: Any) -> None:
    """Print spec-required execute output panels."""
    from cleveragents.domain.models.core.plan import Plan as LifecyclePlan
    if not isinstance(plan, LifecyclePlan):
        return

    plan_id = plan.identity.plan_id
    sandbox = plan.sandbox_refs[0] if plan.sandbox_refs else None
    worker = plan.execution_actor or "local/executor"
    started_str = (
        plan.timestamps.execute_started_at.strftime("%H:%M:%S")
        if plan.timestamps.execute_started_at else "—"
    )

    # Execution panel
    console.print(Panel(
        f"[bold]Plan:[/bold] {plan_id}\n"
        f"[bold]Phase:[/bold] {plan.phase.value}\n"
        f"[bold]Sandbox:[/bold] git_worktree\n"
        f"[bold]Worker:[/bold] {worker}\n"
        f"[bold]Started:[/bold] {started_str}\n"
        f"[bold]Attempt:[/bold] {plan.identity.attempt}",
        title="Execution", expand=False
    ))

    # Sandbox panel
    console.print(Panel(
        f"[bold]Strategy:[/bold] git_worktree\n"
        f"[bold]Path:[/bold] {sandbox or '(pending)'}\n"
        f"[bold]Branch:[/bold] cleveragents/plan-{plan_id[:8]}\n"
        f"[bold]Status:[/bold] {'active' if sandbox else 'pending'}",
        title="Sandbox", expand=False
    ))

    # Strategy Summary panel
    # ... (decisions, invariants, child plans, estimated files, risk)

    # Progress panel
    # ... (4 steps with status indicators)

    console.print("[green]✓ OK[/green] Execution started")

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

## Bug Report **Feature Area:** Plan execution and apply phase **Command:** `agents plan execute <PLAN_ID>` (rich/default output) ### What Was Tested The rich (default) output format of `agents plan execute`. ### Expected Behavior (from spec §agents plan execute) The spec defines four distinct Rich panels for `agents plan execute`: ``` $ agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J ╭─ Execution ──────────────────────╮ │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │ │ Phase: execute │ │ Sandbox: git_worktree │ │ Worker: local/executor │ │ Started: 12:58:10 │ │ Attempt: 1 │ ╰──────────────────────────────────╯ ╭─ Sandbox ──────────────────────────────────╮ │ Strategy: git_worktree │ │ Path: /repos/api/.worktrees/plan-01HXM8 │ │ Branch: cleveragents/plan-01HXM8C2 │ │ Status: active │ ╰────────────────────────────────────────────╯ ╭─ Strategy Summary ─────────────────────╮ │ Decisions: 8 │ │ Invariants: 2 │ │ Planned Child Plans: 2+ │ │ Estimated Files: ~12 │ │ Risk: low │ ╰────────────────────────────────────────╯ ╭─ Progress ─────────╮ │ ⏳ Collect context │ │ • Run tools │ │ • Build changeset │ │ • Validate │ ╰────────────────────╯ ✓ OK Execution started ``` ### Actual Behavior (from code analysis) **File:** `src/cleveragents/cli/commands/plan.py`, lines 2118–2133 ```python if fmt != OutputFormat.RICH.value: ... else: _print_lifecycle_plan(plan, title="Plan Executed") # BUG: shows generic plan details phase_label = f"{plan.phase.value}/{plan.state.value}" if plan.phase == PlanPhase.EXECUTE and plan.state in ( ProcessingState.COMPLETE, ProcessingState.APPLIED, ): console.print( f"\n[dim]Plan execution completed ({phase_label}). " "Run 'agents plan apply <id>' when ready.[/dim]" ) else: console.print( f"\n[dim]Plan is now in {phase_label} state. " "Run 'agents plan execute <id>' to continue.[/dim]" ) ``` The code calls `_print_lifecycle_plan(plan, title="Plan Executed")` which renders a generic plan details panel showing fields like `ID`, `Name`, `Action`, `Phase`, `Processing State`, `Projects`, `Description`, `Strategy Actor`, `Execution Actor`, etc. This is **not** the spec-required output. The spec requires: 1. **"Execution" panel** — Plan ID, Phase, Sandbox strategy, Worker, Started time, Attempt number 2. **"Sandbox" panel** — Strategy, Path, Branch, Status 3. **"Strategy Summary" panel** — Decisions count, Invariants count, Planned Child Plans, Estimated Files, Risk 4. **"Progress" panel** — 4 steps (Collect context, Run tools, Build changeset, Validate) with status indicators 5. **`✓ OK Execution started`** footer line The current output is a generic plan state dump, not the execution-specific view the spec defines. ### Code Location - `src/cleveragents/cli/commands/plan.py`: - `execute_plan()` function, lines 2118–2133 (rich output branch) ### Steps to Reproduce ```bash agents plan use local/some-action my-project agents plan execute <PLAN_ID> # Observe: generic plan details panel instead of Execution/Sandbox/Progress panels ``` ### Impact The primary user-facing output of `agents plan execute` does not match the spec. Users see a generic plan state dump instead of the execution-focused view with sandbox details, strategy summary, and progress steps. This is the most visible output of the core plan execution workflow. ### Fix Suggestion Replace the `_print_lifecycle_plan(plan, title="Plan Executed")` call with a dedicated `_print_execute_output(plan)` function that renders the four spec-required panels: ```python def _print_execute_output(plan: Any) -> None: """Print spec-required execute output panels.""" from cleveragents.domain.models.core.plan import Plan as LifecyclePlan if not isinstance(plan, LifecyclePlan): return plan_id = plan.identity.plan_id sandbox = plan.sandbox_refs[0] if plan.sandbox_refs else None worker = plan.execution_actor or "local/executor" started_str = ( plan.timestamps.execute_started_at.strftime("%H:%M:%S") if plan.timestamps.execute_started_at else "—" ) # Execution panel console.print(Panel( f"[bold]Plan:[/bold] {plan_id}\n" f"[bold]Phase:[/bold] {plan.phase.value}\n" f"[bold]Sandbox:[/bold] git_worktree\n" f"[bold]Worker:[/bold] {worker}\n" f"[bold]Started:[/bold] {started_str}\n" f"[bold]Attempt:[/bold] {plan.identity.attempt}", title="Execution", expand=False )) # Sandbox panel console.print(Panel( f"[bold]Strategy:[/bold] git_worktree\n" f"[bold]Path:[/bold] {sandbox or '(pending)'}\n" f"[bold]Branch:[/bold] cleveragents/plan-{plan_id[:8]}\n" f"[bold]Status:[/bold] {'active' if sandbox else 'pending'}", title="Sandbox", expand=False )) # Strategy Summary panel # ... (decisions, invariants, child plans, estimated files, risk) # Progress panel # ... (4 steps with status indicators) console.print("[green]✓ OK[/green] Execution started") ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — spec compliance bug identified by UAT testing
  • Story Points: 3 (M) — targeted fix to align implementation with spec
  • MoSCoW: Must Have — spec compliance is required for correct system behavior

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — spec compliance bug identified by UAT testing - **Story Points**: 3 (M) — targeted fix to align implementation with spec - **MoSCoW**: Must Have — spec compliance is required for correct system behavior --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:05:31 +00:00
Author
Owner

Implementation Attempt — Tier 3: sonnet — Success

Implemented the spec-required rich output panels for agents plan execute in src/cleveragents/cli/commands/plan.py.

Changes made:

  • Added _print_execute_output(plan) function that renders the four spec-required panels:
    1. Execution — Plan ID, Phase, Sandbox strategy, Worker, Started, Attempt
    2. Sandbox — Strategy, Path, Branch, Status
    3. Strategy Summary — Decisions, Invariants, Planned Child Plans, Estimated Files, Risk
    4. Progress — 4 steps (Collect context, Run tools, Build changeset, Validate) with status indicators
    • Followed by ✓ OK Execution started footer line
  • Replaced _print_lifecycle_plan(plan, title="Plan Executed") call with _print_execute_output(plan) in the execute_plan rich output branch
  • Added BDD tests tagged @tdd_issue @tdd_issue_4737 in features/plan_cli_coverage_boost.feature to verify the spec-required output
  • Added step definition I invoke execute in rich format and plan id in features/steps/plan_cli_coverage_boost_steps.py

Quality gates: lint ✓, typecheck ✓, format ✓
Note: Unit tests could not be run locally due to a pre-existing environment hang issue (behave-parallel hangs after loading step definitions). CI will run the full test suite.

PR: #10905#10905


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: task-implementor

**Implementation Attempt** — Tier 3: sonnet — Success Implemented the spec-required rich output panels for `agents plan execute` in `src/cleveragents/cli/commands/plan.py`. **Changes made:** - Added `_print_execute_output(plan)` function that renders the four spec-required panels: 1. **Execution** — Plan ID, Phase, Sandbox strategy, Worker, Started, Attempt 2. **Sandbox** — Strategy, Path, Branch, Status 3. **Strategy Summary** — Decisions, Invariants, Planned Child Plans, Estimated Files, Risk 4. **Progress** — 4 steps (Collect context, Run tools, Build changeset, Validate) with status indicators - Followed by `✓ OK Execution started` footer line - Replaced `_print_lifecycle_plan(plan, title="Plan Executed")` call with `_print_execute_output(plan)` in the `execute_plan` rich output branch - Added BDD tests tagged `@tdd_issue @tdd_issue_4737` in `features/plan_cli_coverage_boost.feature` to verify the spec-required output - Added step definition `I invoke execute in rich format and plan id` in `features/steps/plan_cli_coverage_boost_steps.py` **Quality gates:** lint ✓, typecheck ✓, format ✓ **Note:** Unit tests could not be run locally due to a pre-existing environment hang issue (behave-parallel hangs after loading step definitions). CI will run the full test suite. **PR:** #10905 — https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/10905 --- Automated by CleverAgents Bot Supervisor: Implementation | Agent: task-implementor
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#4737
No description provided.