fix(cli): warn when PowerShell mangles piped dumps - #6418
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 587ce19105
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@d8fecc763755d6db3342a0a6605fe29e9e1aa293Preview package for commit |
|
/ai-review |
There was a problem hiding this comment.
Superseded by a newer AI review
🤖 AI Review
Seven reported findings deduplicate to six. All are confirmed: the main concern is that the Windows shell heuristic is both over- and under-inclusive; the remaining items are a production-layer test gap and four nits. No critical or major issue was found.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/legacy/commands/db/dump/dump.handler.ts:276 |
correctness |
claude+codex | The pipe heuristic cannot identify the redirecting shell: it warns for byte-faithful Windows pipes and suppresses warnings when MSYS/mintty variables are inherited by a PowerShell child. |
| 🟡 MINOR | apps/cli/src/shared/runtime/tty.layer.ts:11 |
test-coverage |
claude | The production stdout pipe-detection primitive is untested, while command tests replace it with a mocked stdoutIsPipe value. |
| ⚪ NIT | apps/cli/src/legacy/commands/db/dump/dump.handler.ts:279 |
correctness |
claude | An explicitly empty MSYSTEM environment variable suppresses the warning as though an MSYS session had been detected. |
| ⚪ NIT | apps/cli/src/legacy/commands/db/dump/dump.handler.ts:338 |
readability |
claude | The non-ASCII scan communicates its latched state indirectly by assigning on every iteration and relying on the loop condition to preserve a true result. |
| ⚪ NIT | apps/cli/src/shared/runtime/tty.service.ts:6 |
documentation |
claude | The stdoutIsPipe documentation is broader than its FIFO-only implementation and does not disclose that socket-backed stdout channels return false. |
| ⚪ NIT | apps/cli/src/legacy/commands/db/dump/dump.handler.ts:276 |
code-quality |
claude | The handler computes the pipe/env tracking gate for --file dumps even though that branch never scans stdout, and the tests do not explicitly pin silence for that combination. |
Stats
Claude findings: 6 · Codex findings: 1 · Confirmed: 6 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5 + gpt-5.6-sol · Trigger: manual · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
TL;DR
Windows PowerShell 5.1 re-encodes piped native stdout and corrupts multi-byte UTF-8 in
db dumpoutputso: added one stderr warning pointing at
--file, only when a piped Windows dump actually contains non-ASCII bytes...ref