Skip to content

修复单实例生命周期并清理旧架构测试 - #118

Merged
ACCSCI merged 2 commits into
masterfrom
codex/logic-fixes
Jul 16, 2026
Merged

修复单实例生命周期并清理旧架构测试#118
ACCSCI merged 2 commits into
masterfrom
codex/logic-fixes

Conversation

@ACCSCI

@ACCSCI ACCSCI commented Jul 16, 2026

Copy link
Copy Markdown
Owner

变更概述

  • 修复单实例架构下 session 恢复、端口所有权与原子重新分配,失败时保留原端口
  • 隔离 dev/test 的 userData 与全局项目数据库,并迁移旧项目记录
  • 修复 Windows 异步 hook 删除 session 时的 EBUSY;hook 超时到点立即返回,进程树继续清理
  • 修复英文模式无项目首页仍显示中文的问题
  • 修复 IPC、preload、query 数据契约、空值处理和前端可访问性问题
  • 删除已退出架构的 daemon/SSE/WAL/多实例测试与旧 acceptance 辅助代码
  • 清理 TypeScript/Biome 技术债,全仓 lint 达到 0 error / 0 warning

测试

  • bun run lint
  • bun run typecheck
  • bun run test
  • bunx tsc -b && bunx electron-vite build
  • Electron E2E:启动/IPC、英文首页、孤儿清理、session 创建删除流程
  • bun run dev:3:确认 main、preload、renderer、51 个 IPC handler、隔离数据库和窗口加载成功

补充说明

  • bun run build 的 prebuild 会联网下载字体;本机 GitHub 大文件下载长时间无响应,因此生产代码构建使用等价的 bunx tsc -b && bunx electron-vite build 验证并通过。
  • 本 PR 包含全仓 Biome 格式化,机械格式变化较多。

Copilot AI review requested due to automatic review settings July 16, 2026 13:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread electron/main/ipc/sessions.ts Outdated
Comment thread electron/main/ipc/sessions.ts Outdated
Comment thread electron/main/session-recovery.ts
Comment thread electron.vite.config.ts
@ACCSCI
ACCSCI merged commit d5e18c4 into master Jul 16, 2026
1 check passed
@ACCSCI
ACCSCI deleted the codex/logic-fixes branch July 16, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants