Skip to content

Fix confirmation EOF guidance and preserve structured stdout - #58

Open
vahidgr wants to merge 1 commit into
render-oss:mainfrom
vahidgr:fix/confirmation-eof-json-output
Open

vahidgr wants to merge 1 commit into
render-oss:mainfrom
vahidgr:fix/confirmation-eof-json-output

Conversation

@vahidgr

@vahidgr vahidgr commented Oct 20, 2026

Copy link
Copy Markdown

Non-interactive commands that require confirmation write their prompt and cancellation notice to stdout, corrupting --output json even when the user accepts. When stdin is closed, the command instead returns a bare EOF without explaining the required confirmation.

Send confirmation prompts and cancellation notices to stderr, and wrap confirmation EOF with guidance to rerun with --confirm. Preserve the confirmation gate and the underlying EOF for error inspection. Regression tests cover closed/unterminated stdin, acceptance, decline, explicit confirmation, other read failures, and deployment creation with JSON output under TTY and non-TTY runtime signals. The deployment tests verify that no POST occurs before confirmation and that confirmed requests forward the commit and return clean JSON.

Validation:

  • go test ./cmd/... ./pkg/... ./internal/...
  • go test -race ./cmd ./pkg/command -run 'TestDeployCreateJSONConfirmation|TestNonInteractiveWithConfirm' -count=1
  • git diff --check

@vahidgr vahidgr closed this Oct 26, 2026
@vahidgr vahidgr reopened this Oct 26, 2026
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.

2 participants