Skip to content

runtime-node: prevent duplicate ProcessIO writes under backpressure#181

Merged
bbopen merged 1 commit intomainfrom
codex/144-processio-backpressure-no-duplicate-writes
Feb 12, 2026
Merged

runtime-node: prevent duplicate ProcessIO writes under backpressure#181
bbopen merged 1 commit intomainfrom
codex/144-processio-backpressure-no-duplicate-writes

Conversation

@bbopen
Copy link
Owner

@bbopen bbopen commented Feb 12, 2026

Summary

  • fix ProcessIO backpressure handling so writes are not replayed when stdin.write() returns false
  • treat write() === false as accepted-by-buffer and pause only subsequent writes until drain
  • add regression tests that fail if writes are duplicated during drain/backpressure cycles

Why this matters

Node stream semantics guarantee that write() returning false means the chunk was accepted and buffered. Re-queueing that same chunk can duplicate protocol frames and cause incorrect request delivery.

Validation

  • npx eslint src/runtime/process-io.ts test/transport.test.ts
  • npm run typecheck
  • npm test -- test/transport.test.ts
  • npm test -- test/runtime_node.test.ts

Closes #144

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Warning

Rate limit exceeded

@bbopen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d0a2513 and 481af4d.

📒 Files selected for processing (2)
  • src/runtime/process-io.ts
  • test/transport.test.ts
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/144-processio-backpressure-no-duplicate-writes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bbopen bbopen added area:runtime-node Area: Node runtime bridge priority:p2 Priority P2 (medium) labels Feb 12, 2026
@bbopen bbopen merged commit 03c46ec into main Feb 12, 2026
20 checks passed
@bbopen bbopen deleted the codex/144-processio-backpressure-no-duplicate-writes branch February 12, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime-node Area: Node runtime bridge priority:p2 Priority P2 (medium)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arch: Robust ProcessIO wrapper for stream handling

1 participant