Skip to content

feat: confirm destructive operations - #291

Merged
Patel230 merged 1 commit into
mainfrom
feat/confirm-destructive
Sep 7, 2026
Merged

feat: confirm destructive operations#291
Patel230 merged 1 commit into
mainfrom
feat/confirm-destructive

Conversation

@Patel230

@Patel230 Patel230 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds confirmDestructive, a [y/N] confirmation prompt for hard-to-undo CLI operations. It only prompts when interactive (CanPrompt(): TTY stdin, not --quiet); scripted/piped runs auto-approve so automation is never blocked. A declined prompt prints Cancelled. and exits cleanly (exit 0).

Applied to: agent remove, credentials remove, checkpoint delete, skills remove, trust remove, permissions reset, taste reset (explicitly "cannot be undone"), learn clear. Skipped eval cache-clear (disposable cache).

Verification

  • go build ./..., go vet ./cmd/, gofumpt -l clean.
  • go test ./... exit 0.
  • New TestParseConfirm covers the yes/no decision logic.
  • Smoke: non-interactive agent remove / learn clear still work (auto-approve, no block).

Add confirmDestructive, a [y/N] prompt gated on CanPrompt (interactive TTY,
not --quiet). Non-interactive/scripted runs auto-approve so automation is
never blocked; a declined prompt prints 'Cancelled.' and exits cleanly.

Apply it to the hard-to-undo commands: agent remove, credentials remove,
checkpoint delete, skills remove, trust remove, permissions reset, taste
reset (explicitly 'cannot be undone'), and learn clear. Skip eval cache-clear
(disposable cache).

Extract parseConfirm for the yes/no decision and unit-test it.
@Patel230
Patel230 merged commit 6b03fc1 into main Sep 7, 2026
25 of 26 checks passed
@Patel230
Patel230 deleted the feat/confirm-destructive branch September 7, 2026 07:25
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.

1 participant