Skip to content

fix: 托盘与 session-host 同生共死,并修正安装文档 - #26

Merged
starsstreaming merged 1 commit into
mainfrom
fix/tray-lifecycle-and-docs
Aug 17, 2026
Merged

fix: 托盘与 session-host 同生共死,并修正安装文档#26
starsstreaming merged 1 commit into
mainfrom
fix/tray-lifecycle-and-docs

Conversation

@starsstreaming

@starsstreaming starsstreaming commented Aug 17, 2026

Copy link
Copy Markdown
Owner

背景

飞哥在 v1.0.0 上测到二次启动 session-host exited early (1)、托盘图标没了但 node.exe 还在,以及 README 的 dsh plugin add 依赖 pnpm、写死默认路径、假定 dsh 已全局安装。

根因不是固定端口 50067。session-host 本来就是 listen(0)。真正的死循环是:托盘进程没了,孙子进程 node 还占着 injector.lock,再点快捷方式就会抢锁失败。

改动

  • 用 Job Object(KILL_ON_JOB_CLOSE)把 session-host 绑到托盘上,并加 --parent-pid 看守
  • 启动失败 / trap / 退出都走同一套收尸
  • 残留控制面 /health 通就接管,不通且持有者是 session-host.mjs 才杀掉(不杀 DSH)
  • 二次点击发 ShowPanel,不再静默 exit 0
  • 插件进程内 session 看到托盘认领会让出锁;托盘自己的 session-host 响应自己写的 claim
  • README / 集成文档补上:安装包自动写入、不需要 pnpm、npx 写法、自定义目录看 集成说明.txt
  • 版本保持 v1.0.0。新安装包已替换 GitHub Release 上的 beautiCode-Setup-1.0.0-win-x64.exe

本机快捷方式验证

按安装包同一条命令启动(Hidden + start-beauticode.ps1):

  • 首次启动:session-host ready/health open=true,注入锁存在
  • 再点一次:show-panel event received,PID 不变,没有新 session-host
  • 只杀托盘 PowerShell:session-host 约 300ms 内退出,无残留
  • 再启动:重新 ready,不再 exited early
  • 快捷方式弹出选择框,状态为「已连接 DeepSeek Harness / 当前」

验证中还修了两个现场 bug:PowerShell 不能给只读自动变量 $PID 赋值;托盘自己的 claim 不能让 session-host 自杀。

测试

npm test 通过。

Second launches were dying on leftover session-host locks, and testers
who followed the README hit pnpm / dsh / custom-path errors.

- Bind session-host to a kill-on-close job and watch the tray parent pid
- Adopt a healthy leftover control plane, otherwise kill only session-host
- Signal ShowPanel on a second shortcut click instead of exiting silently
- Let in-process DSH sessions yield the lock; the tray host ignores its own claim
- Document installer auto-wiring, npx, and the real install directory
- Ship 集成说明.txt from the installer and bump the package to 1.0.1
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 01a57a97-9fde-4d41-9d2a-3a871495dca0


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@starsstreaming
starsstreaming merged commit 7bcc264 into main Aug 17, 2026
5 of 9 checks passed
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.

1 participant