Repository navigation
Conversation
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 7 commands. Binary size: 134.0 MB, unchanged. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews were available. Confirmed a scheduler-test coverage gap and a narrowly scoped robustness nit concerning injected Stdio services. The pinned Bun 1.4.4 returns null for healthy process streams, so the hypothetical missing-property crash was not observed. Full tests could not run because dependencies are absent.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/shared/output/output.layer.unit.test.ts:881 |
test-quality |
codex | The scheduler regression test can pass if a yield between the preflight check and sink subscription reintroduces the missed-error hang. |
| ⚪ NIT | apps/cli/src/shared/output/output.layer.ts:97 |
robustness |
claude | The preflight check gates injected Stdio sinks on the real process streams: a healthy substitute sink is skipped whenever the corresponding process stream is errored. It also treats undefined as an error, so a replacement process stream lacking the errored property would turn ordinary output into a PlatformError defect. |
Stats
Claude findings: 1 · Codex findings: 1 · Confirmed: 2 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
…0-cpu-forever-when-stdout-and
kanadgupta
left a comment
There was a problem hiding this comment.
no notes from me ✅ per the claude analysis below, i'd ask the user to install the next beta build and confirm that they can no longer reliably reproduce the issue on macOS 27
claude analysis
LGTM
No blocking findings. One thing is unverified: the macOS 27 trigger.
Why the fix works
- A direct write to a closed pipe returns
false, but Bun setserroredone microtask later. - A sink attached after that misses the
errorevent and waits fordrainforever. writeStdiocheckserroredfirst and never yields before the sink listens, so the late event can't be missed.- A sample of a hung pre-fix binary shows the same
kevent64spin as in #6846.
What I ran
Real binary on macOS 26.7 (Bun 1.4.4), reader closed, 3 runs each:
| Case | Pre-fix | This PR |
|---|---|---|
--debug, stderr closed |
hangs 3/3 (~100% CPU) | exits 0, 3/3 |
| 5 other closed-pipe cases | exits 0 | exits 0 |
- New E2E fails on the pre-fix binary (60 s timeout) and passes on this PR.
- 126 unit tests in the two touched suites pass.
oxlint,oxfmt --checkandtsc --noEmitare clean on the changed files.- CI is green.
- No other code writes to stdout or stderr through
Stdio, so nothing is missed.
Not verified
- I couldn't reproduce the macOS 27 cases (
status,db query --linked,projects list). They need Docker or a linked project. - I don't know why macOS 27 sends progress writes into the closed pipe first. A timing race fits the "2 of 3 runs hang" report, but that is a guess.
- Suggest asking the #6846 reporters to try a preview build on macOS 27.
Non-blocking note
- If
erroredisn'tEPIPE(for exampleEIOafter a terminal closes), the run now fails with an error instead of hanging. That is fine as is.
TL;DR
stops the cli spinning forever when the reader of its output exits early
whats improved/fixed?
piping text output into a reader that exits early, like
supabase projects list | true, left the cli spinning at full cpu and never exiting, and--debugdid the sameprogress lines and
--debuglogs write to the pipe directly, so bun marks the stream failed without the output writer noticing, and the next write waits for adrainthat never comeshow?
every stdio write, from the output writer and the debug trace spans alike, now fails right away on an already failed stream, so the existing closed pipe handling ends the run with exit 0
each write also runs without yielding, so the late
errorevent from a direct write cannot slip past that checkref:
supabase statusspins at ~160% CPU forever when stdout and stderr share a pipe whose reader closes early #6846