Fix silent non-TTY intent execution mode#32
Draft
CoreyRDean wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-technical summary
This fixes a pipe/redirect behavior gap in
intent's natural-language mode. When output was no longer going to a terminal, the spec saidintentshould stop behaving like an interactive app and silently autorun only safe or network work. In practice, the CLI still keyed that behavior mostly offstdin, which left cases likei ... | caton the wrong side of the contract. After this change, non-TTY output consistently uses the silent path and only higher-risk work still fails closed.Technical summary
internal/cli/intent.goso the CLI records whetherstdinandstdoutare TTYs and derives quiet/autorun defaults from that policystdoutthe same way the v1 spec defines it: quiet mode, no interactive proposal UI, and implicit--yessemantics only forsafeandnetworkresponsesstdout,stdin, andstderrare all interactive, instead of prompting on partially interactive surfacesinternal/cli/intent_test.gofor stdout-piped autorun defaults, stdin-piped autorun defaults, and the full-TTY requirement for interactive confirmationgo test ./internal/cli/...,go test ./...,go vet ./..., andmake builddocs/SPEC.mdAdditional notes
Trade-off: the tests cover the policy seam directly instead of trying to fake PTY devices in-process, which keeps the regression stable while still locking the intended behavior.
Deferred: this does not touch adjacent open issues like
--literal, file-edit grounding, or shell-environment activation because they are separate increments.Remaining gap: this patch fixes the CLI-side non-TTY execution contract; it does not broaden the natural-language mode beyond the current v1 surface.