Skip to content

feat(minimal): add bulk session destruction - #811

Merged
twitchyliquid64 merged 2 commits into
mainfrom
amp-codex-5.5-test-805-destroy-all
Jul 17, 2026
Merged

feat(minimal): add bulk session destruction#811
twitchyliquid64 merged 2 commits into
mainfrom
amp-codex-5.5-test-805-destroy-all

Conversation

@jtnkminimal

@jtnkminimal jtnkminimal commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Enhanced the destroy CLI to terminate either one specified session or all active sessions in a single command.
    • Added interactive yes/no confirmation for bulk destruction (configurable via force), while supporting non-interactive/forced execution.
  • Bug Fixes
    • Bulk destruction now stops and reports when any session removal fails.
    • “Destroy all” now succeeds cleanly when there are no active sessions.
  • Tests
    • Expanded CLI integration coverage for both single-session and all-sessions destroy flows.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9d4a332a-7955-4b2c-9471-ca918087b9c3

📥 Commits

Reviewing files that changed from the base of the PR and between ae0bfa8 and 3810341.

📒 Files selected for processing (1)
  • crates/minimal/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/minimal/src/lib.rs

📝 Walkthrough

Walkthrough

The destroy CLI now accepts either a session identifier or --all. All-session destruction lists active sessions, optionally prompts with default-no confirmation, supports --force, and reports failed destruction RPCs. Confirmation callers and integration tests were updated.

Changes

Session destruction

Layer / File(s) Summary
Destroy command flow
crates/minimal/src/lib.rs
DestroyArgs supports optional sessions, --all, and --force; command helpers implement single-session and all-session destruction with confirmation and failure handling. Confirmation callers now specify their defaults.
Destroy flow integration tests
crates/minimal/tests/cli.rs
Existing single-session tests use the optional argument shape, and new tests cover deleting all sessions and handling no active sessions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • gominimal/inbox/306 — Covers the requested all-session enumeration, confirmation, force mode, and per-session destruction.
  • gominimal/minimal/805 — Covers the requested all-session destroy functionality.

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
Loading

Poem

A bunny found sessions lined in a row,
“Destroy them all?” with a cautious no.
Say yes, or force the burrow clear,
Each vanished session brings rabbit cheer.
Tests hop after, neat and bright.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding bulk session destruction in minimal.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/minimal/tests/cli.rs (1)

313-350: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add parser-level tests for the new CLI contract.

These tests construct DestroyArgs directly, so they do not validate clap’s new constraints. Cover no target, SESSION --all, and --force without --all to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2d0e5e6 and ae0bfa8.

📒 Files selected for processing (2)
  • crates/minimal/src/lib.rs
  • crates/minimal/tests/cli.rs

Comment thread crates/minimal/src/lib.rs
#[arg(long)]
pub all: bool,
/// Skip confirmation when destroying all sessions
#[arg(long, short, requires = "all")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user did --all, do we really need a confirmation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/minimal/src/lib.rs Outdated
}

/// Prompt for confirmation, defaulting to no.
fn confirm_default_no(question: &str) -> Result<bool, anyhow::Error> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we are keeping the confirmation: use the existing confirm() function, add parameters for the default no etc as you need to

@jtnkminimal

Copy link
Copy Markdown
Contributor Author

Addressed in 38103415: the existing confirm helper now accepts an explicit default, renders [Y/n] or [y/N], and all existing call sites pass their intended default. The duplicate confirm_default_no helper has been removed.

@twitchyliquid64
twitchyliquid64 enabled auto-merge (squash) July 17, 2026 18:16
@twitchyliquid64
twitchyliquid64 merged commit 02ea2f4 into main Jul 17, 2026
28 checks passed
@twitchyliquid64
twitchyliquid64 deleted the amp-codex-5.5-test-805-destroy-all branch July 17, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants