fix(cli): add checkpoint label, creation time, and side effects to rollback confirmation prompt #3470

Merged
freemo merged 1 commits from fix/uat-rollback-confirmation-prompt into master 2026-04-05 21:06:56 +00:00

1 Commits

Author SHA1 Message Date
freemo 631e847497 fix(cli): add checkpoint label, creation time, and side effects to rollback confirmation prompt
CI / lint (pull_request) Successful in 25s
CI / typecheck (pull_request) Successful in 46s
CI / quality (pull_request) Successful in 35s
CI / security (pull_request) Successful in 1m7s
CI / build (pull_request) Successful in 28s
CI / helm (pull_request) Successful in 25s
CI / unit_tests (pull_request) Successful in 7m6s
CI / e2e_tests (pull_request) Successful in 18m1s
CI / integration_tests (pull_request) Successful in 22m28s
CI / docker (pull_request) Successful in 1m25s
CI / coverage (pull_request) Successful in 10m44s
CI / status-check (pull_request) Successful in 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m53s
Resolves issue #3443: the `agents plan rollback` confirmation prompt was
missing the checkpoint's descriptive label, relative creation time, and
side-effects count (decisions invalidated / child plans cancelled).

Changes:
- Added `_format_relative_time(dt)` helper to produce human-readable
  relative timestamps (e.g. "42 minutes ago", "2 hours ago").
- In `rollback_plan`, moved `get_container()` / `checkpoint_service()`
  before the confirmation block so checkpoint metadata is available.
- When `--yes` is not passed, `svc.get_checkpoint()` is called to fetch
  the checkpoint label (`metadata.reason`) and creation time.
- Decisions created after the checkpoint are counted via
  `decision_service.list_decisions()`; `subplan_spawn` /
  `subplan_parallel_spawn` decisions are counted as child plans.
- Side-effects line is printed before the prompt when counts > 0.
- Falls back to the original simple prompt if checkpoint metadata
  cannot be fetched (e.g. checkpoint not found).
- Updated existing rollback mock helpers to wire `get_checkpoint` and
  `decision_service` properly.
- Added 3 new Behave scenarios covering label display, side-effects
  display, and fallback behaviour.

Closes #3443
2026-04-05 19:46:23 +00:00