fix(cli): render spec-required panels in agents plan rollback rich output #3279

Merged
freemo merged 1 commits from fix/plan-rollback-rich-output-panels into master 2026-04-05 17:59:07 +00:00

1 Commits

Author SHA1 Message Date
freemo 89c215e62c fix(cli): render spec-required panels in agents plan rollback rich output
CI / lint (pull_request) Successful in 26s
CI / build (pull_request) Successful in 39s
CI / quality (pull_request) Successful in 45s
CI / typecheck (pull_request) Successful in 50s
CI / security (pull_request) Successful in 1m2s
CI / helm (pull_request) Successful in 39s
CI / unit_tests (pull_request) Successful in 6m50s
CI / docker (pull_request) Successful in 1m22s
CI / coverage (pull_request) Successful in 10m47s
CI / e2e_tests (pull_request) Successful in 17m11s
CI / integration_tests (pull_request) Successful in 23m20s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m43s
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
2026-04-05 17:35:35 +00:00