Preserve buffered NodeTerminal readLine input - #6679
Conversation
🦋 Changeset detectedLatest commit: b2978de The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reached
Next review available in: 15 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughNodeTerminal now creates one readline interface per scope, buffers line events in a shared queue, and consumes them sequentially. Tests add a two-line fixture mode and verify both lines are preserved. A patch changeset documents the behavior. ChangesNodeTerminal buffered reads
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Comment |
Bundle Size Analysis
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/platform-node-shared/src/NodeTerminal.ts`:
- Around line 52-60: Update the readInput setup around readline.createInterface
and the inputEnded state so an already-ended stdin immediately closes the lines
queue with the same QuitError behavior expected by late subscribers. Preserve
the existing rl "close" handler for streams that end after interface creation,
and ensure Queue.take(lines) cannot remain pending when stdin has ended before
readInput runs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 44ef9da2-eca4-4016-acc1-8befac7f6fa2
📒 Files selected for processing (4)
.changeset/fresh-lines-wait.mdpackages/platform-node-shared/src/NodeTerminal.tspackages/platform-node-shared/test/NodeTerminal.test.tspackages/platform-node-shared/test/fixtures/node-terminal.ts
Summary
readLinecalls do not drop piped inputQuitErrorafter buffered lines are drained at EOFTesting
pnpm --filter @effect/platform-node-shared test --run test/NodeTerminal.test.tspnpm lint-fixpnpm checkCloses EFF-135
Summary by CodeRabbit
Bug Fixes
Tests
Chores