#50 (comment)
CommandContext.IsInteractive (internal/cmd/command_context.go) decides by checking fi.Mode()&os.ModeCharDevice, but /dev/null is a character device without being a terminal, so it reports true.
Effect: baseten loops run deactivate --run-id X </dev/null slips past the --yes guard and tries to prompt. In an interactive shell it opens /dev/tty and prompts even though the help says --yes is required; in cron or CI, where stdin is often /dev/null, it dies with huh: could not open a new TTY: open /dev/tty: device not configured instead of the "pass --yes" usage error.
Six call sites are affected, not just the confirmation guard: four in command.auth.go (device-flow login, profile selection), plus org secret and model.
Fix is term.IsTerminal(int(f.Fd())) from golang.org/x/term, already in go.sum transitively and needing promotion to a direct dependency. The auth paths should be exercised since their behavior changes too.
Reported by @spal1.
#50 (comment)
CommandContext.IsInteractive(internal/cmd/command_context.go) decides by checkingfi.Mode()&os.ModeCharDevice, but/dev/nullis a character device without being a terminal, so it reports true.Effect:
baseten loops run deactivate --run-id X </dev/nullslips past the--yesguard and tries to prompt. In an interactive shell it opens/dev/ttyand prompts even though the help says--yesis required; in cron or CI, where stdin is often/dev/null, it dies withhuh: could not open a new TTY: open /dev/tty: device not configuredinstead of the "pass --yes" usage error.Six call sites are affected, not just the confirmation guard: four in
command.auth.go(device-flow login, profile selection), plusorg secretandmodel.Fix is
term.IsTerminal(int(f.Fd()))fromgolang.org/x/term, already ingo.sumtransitively and needing promotion to a direct dependency. The auth paths should be exercised since their behavior changes too.Reported by @spal1.