Skip to content

Improve CLI stdin detection for cross-platform builds#10

Merged
VectoDE merged 2 commits intomainfrom
codex/enable-console-usage-for-builds
Oct 22, 2025
Merged

Improve CLI stdin detection for cross-platform builds#10
VectoDE merged 2 commits intomainfrom
codex/enable-console-usage-for-builds

Conversation

@VectoDE
Copy link
Owner

@VectoDE VectoDE commented Oct 22, 2025

Summary

  • prevent CLI failures when stdin metadata cannot be inspected by falling back to interactive-safe behaviour
  • centralize stdin interactivity checks so prompting and pipe detection works on both Linux and Windows consoles

Testing

  • go test ./...

https://chatgpt.com/codex/tasks/task_e_68f8e564a0dc832cbd8454dba28fd3cf

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 380 to 387
return c.promptToSavePasswordInteractive(reader, password)
}

func (c *CLI) stdinIsInteractive() bool {
interactive, ok := c.detectStdinInteractivity()
if !ok {
return false
}
return interactive
}

func (c *CLI) hasNonInteractiveStdin() bool {
interactive, ok := c.detectStdinInteractivity()
if !ok {
return false
}
return !interactive

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Handle unknown stdin interactivity consistently

If stdinFile.Stat() fails in detectStdinInteractivity both helper methods return false, but they are interpreted in opposite ways: readPasswordFromPipe treats false from hasNonInteractiveStdin as “interactive” and skips reading stdin, while promptToSavePassword treats false from stdinIsInteractive as “non-interactive” and suppresses prompts. On platforms where Stat is unsupported (the scenario this change is meant to cover), piped passwords are silently ignored and the CLI exits with “no password provided” even when input was supplied via a pipe. The error should either be propagated or both helpers should make the same conservative assumption so that piped input is still read.

Useful? React with 👍 / 👎.

@VectoDE VectoDE merged commit 5292fc0 into main Oct 22, 2025
@VectoDE VectoDE deleted the codex/enable-console-usage-for-builds branch October 22, 2025 16:01
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