fix(codex): handle signal-killed process exit during startup#1963
fix(codex): handle signal-killed process exit during startup#1963
Conversation
The exit handler condition `code !== 0 && code !== null` missed the case where the Codex process was killed by a signal (code=null, signal=SIGTERM). This caused handleProcessExit to never run, leaving the child reference dangling until the 5-second timeout fired with a generic error message. Remove the condition so any exit during the startup window is treated as a failure with a descriptive error including both code and signal info. Fixes: ELECTRON-E4
Code Review:fix(codex): handle signal-killed process exit during startup (#1963)变更概述本 PR 修复了 涉及模块: 方案评估结论:✅ 方案合理 方案正确解决了 Sentry ELECTRON-E4 报告的问题。启动阶段进程退出属于异常情况,无论 exit code 是非零还是 null(信号杀死),都应立即 reject 并清理状态。移除条件判断后逻辑更简洁,且不影响正常启动流程(5 秒 timeout resolve 在进程存活时仍然生效)。 问题清单✅ 未发现明显问题,代码质量良好,建议批准合并。 汇总
结论✅ 批准合并 — 修复逻辑正确,覆盖了信号杀死(code=null)和非零退出两种场景。测试重写后结构更清晰、确定性更强。代码干净,无阻塞性问题。 本报告由本地 CONCLUSION: APPROVED |
|
✅ 已自动 review,无阻塞性问题,正在触发自动合并。 |
Summary
CodexConnection.start()that missed signal-killed processes (code=null)code !== 0 && code !== nullevaluates tofalsewhen code is null (signal kill), skippinghandleProcessExitand producing a generic timeout errorSentry: ELECTRON-E4 (9 events, last seen 5 hours ago, multiple users across CA/CN/SG)
Closes #1962
Test plan
bun run lint:fix— no errorsbun run format— cleanbunx tsc --noEmit— no type errorsbun run test— all tests pass