修复单实例生命周期并清理旧架构测试 - #118
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the application's architecture to a single-instance model, removing the external daemon and transitioning session state and port pool management directly into the Electron main process. It introduces session recovery logic to rehydrate persisted sessions on boot and refactors port allocation to swap ownership atomically. The code review feedback is highly constructive and identifies critical issues: first, writePortsToEnv is missing its third parameter (projectPath) in both the port reassignment and rollback handlers in sessions.ts; second, a logical gap in session-recovery.ts allows interrupted 'creating' sessions to permanently hang in the UI without being cleaned up; and third, the validation of FRONTEND_PORT in electron.vite.config.ts lacks a strict integer check despite the error message's assertion.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
变更概述
测试
bun run lintbun run typecheckbun run testbunx tsc -b && bunx electron-vite buildbun run dev:3:确认 main、preload、renderer、51 个 IPC handler、隔离数据库和窗口加载成功补充说明
bun run build的 prebuild 会联网下载字体;本机 GitHub 大文件下载长时间无响应,因此生产代码构建使用等价的bunx tsc -b && bunx electron-vite build验证并通过。