Skip to content

fix(cli): prevent help pipe panic#1433

Open
lyzno1 wants to merge 4 commits intovoidzero-dev:mainfrom
lyzno1:codex/fix-help-pipe-panic
Open

fix(cli): prevent help pipe panic#1433
lyzno1 wants to merge 4 commits intovoidzero-dev:mainfrom
lyzno1:codex/fix-help-pipe-panic

Conversation

@lyzno1
Copy link
Copy Markdown

@lyzno1 lyzno1 commented Apr 21, 2026

Fixes a CLI help path where vp lint --help and vp fmt --help could panic when stdout was closed early by a downstream pipe such as head.

Changes:

  • Capture help stdout for delegated lint and fmt commands before writing it back through the CLI.
  • Skip universal Vite config resolution and config injection for lint/fmt help requests.
  • Add coverage for help flag detection before the -- terminator.

Validated with:

  • cargo test -p vite-plus-cli --lib
  • pnpm -F vite-plus snap-test-local test-panicked-fix
  • pnpm -F vite-plus snap-test-local command-helper

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit d4625a3
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69e78ef8ccdc80000827285a

@lyzno1 lyzno1 marked this pull request as ready for review April 21, 2026 13:57
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 21, 2026

@lyzno1 let's move packages/cli/snap-tests-todo/test-panicked-fix to packages/cli/snap-tests/test-panicked-fix 😄

@lyzno1 lyzno1 force-pushed the codex/fix-help-pipe-panic branch from 3e8b606 to 40f5965 Compare April 21, 2026 14:16
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 21, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ 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".

Copy link
Copy Markdown
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

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

@lyzno1 Nice job! Thanks!

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