From 27af253c662cfb6af51dc872e644a8f6f22cfa49 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Mon, 31 Aug 2026 02:18:55 -0700 Subject: [PATCH] Fix stale comments in ensureDeleteConfirmable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The force-flag work merged in #654 at 7ea0be6, before two comment revisions landed on the feature branch. The historical paragraph now speaks of the old gate in the past tense, and the closing note says what actually happened to isNonInteractiveCommand: the delete path bypasses it — machineReadsThisOutput asks the narrower question — and it is left untouched for its other callers, not "read, never widened". --- internal/commands/helpers.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/commands/helpers.go b/internal/commands/helpers.go index b739499e..b8f6f088 100644 --- a/internal/commands/helpers.go +++ b/internal/commands/helpers.go @@ -112,10 +112,10 @@ func deleteNeedsForce(cmd *cobra.Command) bool { // Machine-output mode skips the prompt entirely, so the delete went through // unconfirmed — `basecamp chat delete --json` destroyed a message with no // statement of intent anywhere in the invocation. And a terminal with stdin -// redirected does not skip the prompt: isNonInteractiveCommand reads flags, the -// env var and stdout, never stdin, so the confirmation is shown to an agent -// that has nothing to type with, and bubbletea answers a non-terminal stdin by -// opening /dev/tty and waiting on the real terminal. +// redirected did not skip the prompt at all: the old gate looked at flags, the +// env var and stdout, never stdin, so the confirmation was shown to an agent +// with nothing to type, and bubbletea answers a non-terminal stdin by opening +// /dev/tty and waiting on the real terminal. // // Both are the same failure — a destructive act with nobody affirming it — so // both get the same answer. Requiring the flag precisely where no human can @@ -125,9 +125,11 @@ func deleteNeedsForce(cmd *cobra.Command) bool { // It asks InteractivePrompt rather than InteractiveStdio because the // confirmation is a huh form, which draws to stderr. // -// isNonInteractiveCommand is read, never widened: its other callers (missingArg, -// noChanges) use it to choose between help and a structured error, and changing -// it would move behavior across many commands. +// isNonInteractiveCommand is deliberately bypassed, not widened. The delete path +// no longer consults it at all — machineReadsThisOutput asks the narrower +// question this needs — and it is left untouched because its other callers +// (missingArg, noChanges) use it to choose between help and a structured error, +// where widening would move behavior across many commands. func ensureDeleteConfirmable(cmd *cobra.Command, force bool) error { if force || !deleteNeedsForce(cmd) { return nil