Skip to content

runtime: match kernel releases per platform and add window docking - #7

Merged
taisuii merged 2 commits into
mainfrom
codex/kernel-release-and-docking
Oct 30, 2026
Merged

taisuii merged 2 commits into
mainfrom
codex/kernel-release-and-docking

Conversation

@taisuii

@taisuii taisuii commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

变更

  • 内核下载按平台/架构跨 Release 查找,跳过只有其他平台包的版本
  • 解压保留 macOS .app 内部相对符号链接,解压后用 realpath 复核不越界
  • 新增 CDP dockWindow,桌面伪嵌入通过 Browser.setWindowBounds 停靠窗口

验证

  • node --test test/kernels-extract.test.mjs test/kernels-release.test.mjs(7/7)
  • 全量 npm test 中 MCP 浏览器用例在本机沙箱因 Chrome sandbox 初始化失败,属环境限制

@taisuii
taisuii merged commit 44a2c31 into main Oct 30, 2026
2 of 4 checks passed
@taisuii
taisuii deleted the codex/kernel-release-and-docking branch November 1, 2026 11:00
taisuii added a commit that referenced this pull request Nov 1, 2026
这条测试从 PR #7 起在 windows-latest 上一直失败,但代码本身没问题:
Windows 内核走 zip 分发,tar + .app 相对链接只服务 macOS。

- 保留 .app 相对链接的用例:加能力探测,本机建不出可穿越的目录符号链接时
  带原因跳过(Windows 无开发者模式是 EPERM,有权限时 Node 也建出文件型链接)。
- 越界链接必须被拒的安全用例:改用直接写 tar 头构造成员,不再依赖
  fs.symlinkSync —— 于是这条安全断言在每个平台都真跑,不再被跳过掩盖。
taisuii added a commit that referenced this pull request Nov 1, 2026
这条测试从 PR #7 起在 windows-latest 上一直失败,但代码本身没问题:
Windows 内核走 zip 分发,tar + .app 相对链接只服务 macOS。

- 保留 .app 相对链接的用例:加能力探测,本机建不出可穿越的目录符号链接时
  带原因跳过(Windows 无开发者模式是 EPERM,有权限时 Node 也建出文件型链接)。
- 越界链接必须被拒的安全用例:改用直接写 tar 头构造成员,不再依赖
  fs.symlinkSync —— 于是这条安全断言在每个平台都真跑,不再被跳过掩盖。
taisuii added a commit that referenced this pull request Nov 1, 2026
* fix(kernel): GitHub API 限流时改走网页通道下载内核

未登录的 GitHub API 每小时只有 60 次额度,用尽后 kernel install 直接失败并只提示
「请求受限,请稍后再试」,用户没有任何补救手段。

- 请求受限(403/429)时改为解析公开网页:/releases 取标签(最多 3 页),
  /releases/expanded_assets/<tag> 取该版本的资源列表,形状与 API 一致后再走原有的
  selectRelease 选择逻辑
- 网页请求单独使用 text/html Accept,否则 github.com 返回 406
- 支持 GH_TOKEN / GITHUB_TOKEN,认证后额度提升到 5000 次/小时
- 限流错误带上额度恢复时间,不再是一句「请稍后再试」

实测:API 返回 403 时,网页通道解析出 3 个可用版本,Windows x64 正确选中
chromium-v146.0.7680.177.5 / cloakbrowser-windows-x64.zip。

* test: 内核解压测试不再在 Windows 上假红

这条测试从 PR #7 起在 windows-latest 上一直失败,但代码本身没问题:
Windows 内核走 zip 分发,tar + .app 相对链接只服务 macOS。

- 保留 .app 相对链接的用例:加能力探测,本机建不出可穿越的目录符号链接时
  带原因跳过(Windows 无开发者模式是 EPERM,有权限时 Node 也建出文件型链接)。
- 越界链接必须被拒的安全用例:改用直接写 tar 头构造成员,不再依赖
  fs.symlinkSync —— 于是这条安全断言在每个平台都真跑,不再被跳过掩盖。
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