feat(minimal): add bulk session destruction - #811
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe destroy CLI now accepts either a session identifier or ChangesSession destruction
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Sequence Diagram(s)sequenceDiagram
participant User
participant cmd_destroy
participant Daemon
User->>cmd_destroy: Select --all
cmd_destroy->>Daemon: ListSessions
cmd_destroy->>User: Request confirmation unless forced
cmd_destroy->>Daemon: DestroySession for each active session
Daemon-->>cmd_destroy: Return destruction results
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/minimal/tests/cli.rs (1)
313-350: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd parser-level tests for the new CLI contract.
These tests construct
DestroyArgsdirectly, so they do not validate clap’s new constraints. Cover no target,SESSION --all, and--forcewithout--allto prevent argument-metadata regressions.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/minimal/tests/cli.rs` around lines 313 - 350, Add parser-level tests for the DestroyArgs CLI contract, covering rejection of no target, rejection when SESSION is combined with --all, and rejection when --force is used without --all. Exercise clap parsing rather than constructing DestroyArgs directly, and keep the existing runtime tests unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/minimal/tests/cli.rs`:
- Around line 313-350: Add parser-level tests for the DestroyArgs CLI contract,
covering rejection of no target, rejection when SESSION is combined with --all,
and rejection when --force is used without --all. Exercise clap parsing rather
than constructing DestroyArgs directly, and keep the existing runtime tests
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 54ddbf60-757e-4044-a200-0d45d82d144d
📒 Files selected for processing (2)
crates/minimal/src/lib.rscrates/minimal/tests/cli.rs
| #[arg(long)] | ||
| pub all: bool, | ||
| /// Skip confirmation when destroying all sessions | ||
| #[arg(long, short, requires = "all")] |
There was a problem hiding this comment.
If a user did --all, do we really need a confirmation?
There was a problem hiding this comment.
I feel a confirm is a nice to have for now, we can remove if it gets annoying but I'd say we're the ones that will be killing everything, most folks will have pets running not cattle.
| } | ||
|
|
||
| /// Prompt for confirmation, defaulting to no. | ||
| fn confirm_default_no(question: &str) -> Result<bool, anyhow::Error> { |
There was a problem hiding this comment.
Assuming we are keeping the confirmation: use the existing confirm() function, add parameters for the default no etc as you need to
|
Addressed in |
Summary by CodeRabbit