fix(desktop): stop renderer before quit cleanup - #3837
Conversation
There was a problem hiding this comment.
I reviewed this head and found no blocking issues on code.
Fixes quit sequence (destroys renderer before retiring Host) and moves prior-crash notice to toast with evidence-on-read. Hosted test: FAILURE on composer-plus-menu-stability is the known race fixed in #3836 (this branch lacks that fix) — not attributable.
No P0-P3 on code.
简体中文
代码无阻断,CI 红与本改动无关。Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
Destroy the main window before retiring the local Runtime Host so the renderer cannot send IPC after its handlers are removed. Generated-by: Codex
ca7d2ae to
413ee07
Compare
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed this head and found no blocking issues.
Rebased onto #3836 fix; quit sequence and diagnostic toast still correct; hosted test and package both SUCCESS.
No P0-P3.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
Astro-Han
left a comment
There was a problem hiding this comment.
APPROVE — 413ee07, no P0-P3, hosted test+package SUCCESS.
Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
English
Summary
Destroy the main Renderer before retiring the owned local Runtime Host. This prevents Renderer IPC from racing handler teardown during a normal Desktop quit and removes misleading
No handler registerederrors from the shutdown log.Verification
npm run devwith an isolated profile and quit through the macOS application quit event; shutdown logged only the clean local Host exitnpx tsc -p apps/desktop/tsconfig.main.json --noEmitnpm run lintnpm run format:checkorigin/mainerror inruntime-host-session-catalog.ts(DesktopSessionSummary.id)AI use
Tool(s) and scope: Codex investigated the shutdown race, implemented the one-line lifecycle ordering fix, and ran verification
Checklist
Does this PR entail a change in behavior?
中文
摘要
在退出自有的本地 Runtime Host 前先销毁主 Renderer,避免正常退出时 Renderer IPC 与 handler 清理发生竞态,并消除退出日志中误导性的
No handler registered错误验证
npm run dev,通过 macOS 应用退出事件退出;日志只保留本地 Host 正常退出记录npx tsc -p apps/desktop/tsconfig.main.json --noEmitnpm run lintnpm run format:checkorigin/main中runtime-host-session-catalog.ts的DesktopSessionSummary.id错误阻断AI 使用
工具及范围:Codex 调查退出竞态、实现一行生命周期顺序修复并完成验证
检查清单
此 PR 是否改变行为?