You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change prevents the host runtime from exiting on an unhandled stream premature-close rejection after a disconnect. It is small, covered by a regression test, and ready to merge.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Windows x64 上的 CodexHost v0.26.0 和 v0.27.0 均出现过相同的 Host Runtime 退出。日志先记录官方 Codex 不可用并安排 1000 ms 后重启,随后记录
FATAL unhandledRejection: Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close,Host 以退出码 1 结束。首次断连的触发源仍待定位。CodexRuntime在等待当前通知转发完成前,会调用frames.next()预读下一帧。输出流在这段时间提前关闭时,预读 Promise 可能在await following前拒绝,触发进程级未处理拒绝,打断已安排的恢复。在发起预读时立即附加拒绝处理,随后仍等待原 Promise,让读失败进入已有的消费错误处理。回归测试使用内存流暂停通知转发,再关闭官方输出,验证关闭通知仍会送达且预读拒绝不会逃逸到进程。
Related issues
N/A
UI Demo
N/A
Test plan
node node_modules/vitest/vitest.mjs run --config tests/vitest.config.js --maxWorkers=1 packages/host-runtime/test/codex-runtime-lifecycle.test.ts。Premature close未处理拒绝并失败。修复后,该文件 5 个测试全部通过。git diff --check通过。