Implemented a rich output upgrade for the agents plan rollback in the CLI by replacing the previous plain-text output in rollback_plan() with a set of four spec-required Rich panels.
- Rollback Summary panel: includes Plan, Checkpoint, Label (only if available), and Files fields.
- Changes Reverted panel: a Rich table with File and Action columns; supports both dict entries and plain string paths for forward compatibility with issue #2454.
- Impact panel: shows Sandbox state and optional fields Child Plans Invalidated, Decisions After CP, Tool Calls After CP.
- Post-Rollback State panel: includes Phase, State, and optional Checkpoints Remaining fields.
- Confirmation line: "✓ OK Rollback complete" displayed after the panels.
- Tests updated: Updated BDD test assertions in features/plan_cli_coverage_r2.feature to align with new panel-based output.
Key design decisions:
- Used getattr(result, field, None) pattern for optional fields not yet present in RollbackResult model (fields: label, child_plans_invalidated, decisions_after_cp, tool_calls_after_cp, phase, state, checkpoints_remaining) to support forward-compatibility as fields get added.
- Handling mixed formats in changed_paths/changes_reverted: both dict-format entries and string-format paths are supported to remain compatible with issue #2454.
- Sandbox state defaults to "restored to {checkpoint_id}" when not explicitly provided.
Files changed:
- src/cleveragents/cli/commands/plan.py (rollback_plan rich output section)
- features/plan_cli_coverage_r2.feature (updated test assertions)
ISSUES CLOSED: #2591