Skip to content

Fix silent non-TTY intent execution mode#32

Draft
CoreyRDean wants to merge 1 commit into
mainfrom
fix/non-tty-output-mode
Draft

Fix silent non-TTY intent execution mode#32
CoreyRDean wants to merge 1 commit into
mainfrom
fix/non-tty-output-mode

Conversation

@CoreyRDean
Copy link
Copy Markdown
Owner

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 said intent should stop behaving like an interactive app and silently autorun only safe or network work. In practice, the CLI still keyed that behavior mostly off stdin, which left cases like i ... | cat on 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

  • centralizes natural-language TTY policy in internal/cli/intent.go so the CLI records whether stdin and stdout are TTYs and derives quiet/autorun defaults from that policy
  • treats non-TTY stdout the same way the v1 spec defines it: quiet mode, no interactive proposal UI, and implicit --yes semantics only for safe and network responses
  • refuses higher-risk proposals unless stdout, stdin, and stderr are all interactive, instead of prompting on partially interactive surfaces
  • adds regression coverage in internal/cli/intent_test.go for stdout-piped autorun defaults, stdin-piped autorun defaults, and the full-TTY requirement for interactive confirmation
  • verification: go test ./internal/cli/..., go test ./..., go vet ./..., and make build
  • breaking changes: none intended; this aligns the implementation with the existing spec in docs/SPEC.md

Additional 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant