Skip to content

feat: 精简公共安装逻辑,新增 Codex、Claude Code、CC Switch、Clash Verge Rev - #1

Merged
LIghtJUNction merged 39 commits into
mainfrom
codex/official-installers-20260920
Sep 20, 2026
Merged

LIghtJUNction merged 39 commits into
mainfrom
codex/official-installers-20260920

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

实现

  • 公共函数按固定 GitHub 提交动态加载,不再复制进每个安装入口,不增加公共模块哈希清单。保留本地 LMM_LIB_DIR、Bash 3.2 / PowerShell 5.1 兼容。
  • 新增 Codex、Claude Code、CC Switch、Clash Verge Rev 的 .sh / .ps1,七个工具由同一份 catalog 生成入口与菜单。
  • Codex / Claude 调用官方原生安装器。Linux 依赖命令覆盖 Debian/Ubuntu、Fedora/RHEL、openSUSE、Arch、Alpine、Void,只在 --install-deps 时运行;不做全系统升级。NixOS 明确要求 Nix 环境。
  • Termux 的 Pi/DSH 使用 Android Node;Codex/Claude 使用已有 PRoot Linux guest,不创建/重置 guest、不关闭沙箱。两个桌面工具在 Termux 隐藏并拒绝直接安装。
  • 桌面工具复用官方发行包和现有包管理器。Clash Verge Rev 不假设存在 AppImage,不自动配置订阅或开启代理/TUN。
  • 保留按官方说明修正的 Pi 安装参数、Windows Bash 检查、package.json 入口解析与 UTF-8 路径处理。详细来源和边界见 docs/install-sources.md。

评论跟进

Fixes #2

针对 https://github.com/TokenNotIncluded/lmm-scripts/pull/1#issuecomment-5750850441:

  • bounded() 的 SIGKILL 定时器保留引用;直接子进程退出后,同组后代仍会被强制终止,外层随后才能释放安装锁、删除 stage 或开始 registry 重试。
  • 首次停止原因保持不变:超时 124、SIGINT 130、SIGTERM 143。子进程正常退出或重复取消不能覆盖取消状态;正常结束和启动失败及时清理普通定时器。
  • 取消不再触发备用 registry 安装,也不再被改写为通用错误码 1。
  • 新增 10 项真实 Unix 进程组回归,检查后代/主进程忽略 SIGTERM、正常/异常结束、启动失败、取消/重复取消、锁和 stage 清理时序、registry 重试时序。每项测试最终清理自己的进程组。

修复提交:7a42eebbdf13cb350f25aca8c466b1ec8964df15。公共库固定引用及菜单均已更新;一次性生成工作流已移除。

验证

待合并且已验证的 HEAD:90496c4d7d4d1ce9b72a230dea885d5d4e1806c9
脚本版本:2026.09.21.1

两个工作流共 8 个任务全部成功:

原有 65 项 Python 回归加新增 10 项,共 75 项;生成文件/菜单一致性、ShellCheck、PowerShell 7 / Windows PowerShell 5.1 检查通过。新增进程组测试在本地 Linux / Node 22.16.0 以及 CI Linux、macOS / Node 24.21.0 通过,旧代码已复现失败。

真实安装验证:Codex/Claude 在 Ubuntu、macOS、Windows 和 Debian 12/Alpine 3.22 容器成功;CC Switch Windows portable 安装及入口检查成功。原有 Linux/macOS Pi、LMM CLI 和 Windows Pi、DSH、LMM CLI 实装通过。

未验证 Android/Termux 真机、其他发行版实际安装、两个桌面工具的 Linux/macOS GUI、Clash Verge Rev Windows 安装窗口,以及真实登录、模型调用或代理功能。本 PR 不部署网站,也不修改上层仓库的子模块指针。

Copilot AI lite review requested due to automatic review settings September 20, 2026 08:21
@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, add credits to your account and enable them for code reviews in your settings.

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-20T08:24:58.108896Z 2fda1c8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction LIghtJUNction changed the title fix: 按官方文档修正安装脚本,补齐平台检查并精简说明 fix: 对齐官方安装方式,补齐 Termux 适配并提取公共函数 Sep 20, 2026
@LIghtJUNction LIghtJUNction changed the title fix: 对齐官方安装方式,补齐 Termux 适配并提取公共函数 refactor: 公共函数改为网络加载,精简安装器并兼容 Termux Sep 20, 2026
@LIghtJUNction LIghtJUNction changed the title refactor: 公共函数改为网络加载,精简安装器并兼容 Termux feat: 精简公共安装逻辑,新增 Codex、Claude Code、CC Switch、Clash Verge Rev Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

本轮源码审查发现一个在本 PR 仍存在的问题,已提交为 #2:bounded() 对三秒后 SIGKILL 的定时器执行 unref(),直接子进程退出后,包装进程可能提前退出,遗留同组后代。

核查的是 a193f70c0d405100f419572bba33ef3df27f1e88 的 templates/lib/node.sh。Linux 上使用原样提取的 JS 和模拟构建进程复现:包装进程约 1.171 秒返回 124,但 4.5 秒后后代仍在运行;仅移除该 unref 的对照组能够完成强制终止。详情和验收要求见 #2,建议合并前补处理及回归测试。

另外,旧 main 的相对 --root 在缓存路径校验前未规范化的问题,已确认本 PR 修正了顺序,没有重复开 Issue。这里是定点审查,不代表整份 PR 或全平台安装测试已经通过。

LIghtJUNction and others added 3 commits September 21, 2026 01:13
Keep the SIGKILL grace timer referenced after the direct child exits.
Preserve cancellation exit codes and do not retry a cancelled install.
Add real Unix process-tree, cleanup-order and registry-retry regressions.

Fixes #2

LIghtJUNction commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

已跟进 #1 (comment) 和 #2,修复提交:7a42eebbdf13cb350f25aca8c466b1ec8964df15。

  • 保留 SIGKILL 宽限定时器引用,直接子进程退出不再使它失效;完成进程组强制清理后,外层才释放锁、删除 stage 或重试。
  • 保留首次停止原因:超时 124、SIGINT 130、SIGTERM 143;重复信号、子进程主动返回 0 不再覆盖取消状态。
  • 取消不再触发备用 registry 安装,也不再丢失为通用退出码 1。正常结束/启动失败及时清理普通定时器。
  • 新增 10 项真实 Unix 进程组回归,覆盖忽略 SIGTERM 的后代/主进程、正常/异常退出、启动失败、取消/重复取消、锁和 stage 清理时序、registry 重试时序。旧代码已复现失败,修复后的测试在本地 Linux 及 CI Linux/macOS 通过。

合并前验证的 HEAD:90496c4d7d4d1ce9b72a230dea885d5d4e1806c9。全部 75 项 Python 回归及两套 CI 的 8 个任务通过:

安装器和菜单已更新固定引用;临时工作流已移除。PR 已合并到 main,合并提交 fde672e,Issue #2 已自动关闭。采用 merge commit 保留被安装器引用的提交历史。未部署网站或更新上层仓库子模块指针;不声称已完成 Termux 真机、GUI、OAuth 或模型调用验证。

@LIghtJUNction
LIghtJUNction merged commit fde672e into main Sep 20, 2026
16 checks passed
@LIghtJUNction
LIghtJUNction deleted the codex/official-installers-20260920 branch September 20, 2026 17:19
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.

fix(installer): keep hard-kill timer alive until timed-out process groups are terminated

2 participants