Launch permission onboarding after npm install - #10
Conversation
Open the bundled onboarding helper during interactive global installs so users hit permissions immediately instead of only reading postinstall text. Document the new auto-launch flow in the repo and generated package README.
There was a problem hiding this comment.
Pull request overview
Updates the npm package install experience to automatically launch the bundled macOS permission onboarding during interactive global installs, and aligns documentation/history with the new flow.
Changes:
- Auto-launch bundled permission onboarding from the generated npm
postinstallscript when appropriate (TTY + global + non-CI). - Update generated package README text and root READMEs (EN/ZH) to describe the automatic onboarding and manual fallback commands.
- Add a history entry documenting the task and scope.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/npm/build-packages.mjs | Generates a postinstall script that best-effort launches the bundled app onboarding and updates install messaging/docs in the generated README. |
| docs/histories/2026-04/20260422-1636-launch-npm-postinstall-onboarding.md | Adds a history record describing the onboarding-on-install change. |
| README.zh-CN.md | Documents automatic onboarding launch for interactive global installs (Chinese). |
| README.md | Documents automatic onboarding launch for interactive global installs (English). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| OPEN_COMPUTER_USE_LAUNCHED_FROM_POSTINSTALL: "1", | ||
| }, | ||
| }); | ||
| child.on("error", () => {}); |
There was a problem hiding this comment.
launchOnboardingIfPossible() returns true immediately after spawn(), even if the spawn fails asynchronously (e.g., EACCES/ENOENT -> error event). This can make launchedOnboarding true and print the “launched automatically” message when nothing was actually started. Consider returning false when child.pid is undefined and/or only setting launchedOnboarding once you have a successful spawn signal; alternatively, make the user-facing message not depend on a best-effort spawn result.
| child.on("error", () => {}); | |
| child.on("error", () => {}); | |
| if (child.pid === undefined) { | |
| return false; | |
| } |
| npm i -g open-computer-use | ||
| ``` | ||
|
|
||
| On interactive local global installs, npm also tries to open the bundled permiso-style permission onboarding automatically. If nothing appears, run `open-computer-use` or `open-computer-use doctor`. |
There was a problem hiding this comment.
This section describes the automatic postinstall onboarding but doesn’t mention the new opt-out env var (OPEN_COMPUTER_USE_SKIP_POSTINSTALL_ONBOARDING=1). Since this is user-facing behavior (auto-launching a GUI app), consider documenting the opt-out here (and/or in a dedicated “Environment variables” section) so users can disable it predictably.
| On interactive local global installs, npm also tries to open the bundled permiso-style permission onboarding automatically. If nothing appears, run `open-computer-use` or `open-computer-use doctor`. | |
| On interactive local global installs, npm also tries to open the bundled permiso-style permission onboarding automatically. To disable that behavior, set `OPEN_COMPUTER_USE_SKIP_POSTINSTALL_ONBOARDING=1` during install. If nothing appears, run `open-computer-use` or `open-computer-use doctor`. |
| npm i -g open-computer-use | ||
| ``` | ||
|
|
||
| 在本机交互式的全局安装场景下,npm 也会尝试自动拉起内置的 permiso 风格权限引导;如果没有弹出来,手动运行 `open-computer-use` 或 `open-computer-use doctor` 即可。 |
There was a problem hiding this comment.
这里说明了 postinstall 会自动拉起权限引导,但没有提到新增的 opt-out 环境变量(OPEN_COMPUTER_USE_SKIP_POSTINSTALL_ONBOARDING=1)。因为这是用户可感知的行为(安装时自动启动 GUI),建议在这里顺带写明如何关闭,方便用户可预期地禁用。
上一轮 iFurySt#10/iFurySt#11/iFurySt#12 的结论建立在只有 1 步元素定向的轨迹上,我自己标注了 "样本太薄"。这一轮补足到 13 步 / 9 步元素定向(含完整对话框链路),结论全变, 并暴露出两个真实缺陷。 缺陷 1(已修):render_visible_cells() 渲染的 cell RnCn 不带 Frame,而它们恰恰是 屏幕上真实可见的——就是坐标寻址取到的当前视口内容。后果是任何"只保留可见节点" 的裁剪会把整个下拉/表格判成不可见并全部丢掉。实测中行距下拉的 cell R3C0 Double 就这样被三种策略同时丢弃,而它正是任务必须点中的元素。 补上 Frame 后 H1 与 H1+H2 的保留率从 88% 回到 100%。 缺陷 2(已定位未修):render_visible_cells() 把角色硬编码成 cell,而 AT-SPI 的 真实角色是 table cell。OSWorld 官方白名单有 table-cell 却没有 cell,于是这些行 被判为无关角色丢掉——这是我们的渲染保真度问题,不是官方策略的弱点。 最终实测(48063 token 基线): H1 只保留可见 41% 保留 100% H3 丢结构容器 72% 保留 100% OSWorld 官方 21% 保留 88% H2 扁平列表 81% 保留 100% H1 + H2 37% 保留 100% <- 推荐 另修评测器两处会高估自己的错误:把官方的 endswith 后缀匹配写成精确集合; 解析器把无名两词角色 toggle button 拆成 role=toggle + name=button。 两次方向都是误伤官方——用更严的规则去比对手等于给自己放水。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
postinstallduring interactive local global installs instead of only printing next stepsNotes
Permisopackage dependency, which currently declaresmacOS 26whileopen-computer-usestill targetsmacOS 14+Validation
make check-docsswift testnode ./scripts/npm/build-packages.mjs --skip-build --out-dir tmp/npm-stageCI=1 node ./tmp/npm-stage/open-computer-use/scripts/postinstall.mjs