Repository navigation
fix(pi): launch hooks through the installed Node entry - #1365
Conversation
- 在生成的 Pi 扩展中记录绝对 Node 与 TeamAI 入口,生命周期事件和项目上下文均直接启动该入口,避免依赖服务 PATH 或 Windows 命令包装器。 - 保留超时、标准输入、会话身份与失败放行行为,更新中英文重装后的刷新说明。 - 受限 PATH 的真实扩展回归在原始主干返回空上下文,修复后成功注入项目内容;191 项相关单测、CLI E2E、构建、类型检查和 lint 通过。
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it records a post-build real-CLI run that generates the Pi extension and verifies project instructions with restricted PATH. The disclosed lack of actual Pi and Windows-host testing is not blocking. Review was read-only; I did not run, build, or install PR code. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc Approving at c8cae2c. With teamai off PATH (PATH /usr/bin:/bin), the extension generated by a build of main (f3cd042) returns nothing from before_agent_start and starts no process. The one from this head returns the team context and dispatches session-start, prompt-submit and instructions. A local Pi 0.99.2 in print mode shows the same before it stops for lack of a model key: no dispatches on main, and session-start plus instructions here. Build, tsc, lint and the PR's unit and e2e files pass, and the new e2e test and the shell: false assertion fail on main. The launcher reuses resolveCliEntry() like OpenClaw and OpenCode, and adds no new home resolver.
- [P2 non-blocking] The Pi readiness check in
channelReadiness(src/instruction-targets.ts:202) compares the whole generated file, which now embedsprocess.execPathand the CLI entry.doctorrun from a copy of the same build at another path reports✖ pi adds the team instructions and rules to its promptand exits 1, andhooks injectfrom that copy flips the original install'sdoctorto✖. Dispatch still works. OpenCode's plugin has had the same comparison since #1336, so one fix in the readiness check (compare without the two path constants) would cover both. - [P3 nit] No caller passes the
entryparameter ofbuildPiExtensionSource. - [P3 nit] Unlike the OpenCode and OpenClaw injectors,
injectPiHooksdoes not warn and return whenresolveCliEntry()is null. The shipped layout always hasdist/index.js, so this is not reachable today.
#1367 (the Hermes half) appends to the end of both diagnostics.md files too, so whichever lands second needs a rebase.
The CI review reports no findings. We agree that nothing blocks, and add the readiness note above, which it did not consider. All CI jobs pass; the GitHub-provider job is skipped by the fork policy.
jeff-r2026
left a comment
There was a problem hiding this comment.
Reviewed and verified on latest main (f3cd042) stacked with the other PRs in this batch: tsc / lint / build pass, related unit and E2E tests pass.
|
The cross-install readiness note is addressed in #1409: only generated launcher metadata is normalized; saved paths must still exist and handler bodies/manifests remain checked. The two new readiness regressions fail before the fix; 328 focused tests and a built-CLI cross-entry doctor scenario pass. This keeps the completed launcher fix here separate from the doctor follow-up. |
- 在生成的 Pi 扩展中记录绝对 Node 与 TeamAI 入口,生命周期事件和项目上下文均直接启动该入口,避免依赖服务 PATH 或 Windows 命令包装器。 - 保留超时、标准输入、会话身份与失败放行行为,更新中英文重装后的刷新说明。 - 受限 PATH 的真实扩展回归在原始主干返回空上下文,修复后成功注入项目内容;191 项相关单测、CLI E2E、构建、类型检查和 lint 通过。
A Pi session launched without
teamaion PATH silently lost lifecycle dispatch and project instructions. Generate the extension with the installed Node executable and CLI entry, and launch both lifecycle events and the instructions request directly without a shell. Existing marker ownership, stdin payloads, timeouts and fail-open behavior remain.Refs #1221 (the Pi PATH finding). This PR addresses only that finding, not the full descriptor roadmap.
Validation on main
f3cd0425plus this change:undefinedinstead of the project context; it passes with the fix.npx vitest run src/__tests__/pi-hooks.test.ts src/__tests__/recall-attribution.test.ts: 191 passed. The unit-only extension host strips Node's entry argument before its existing dispatcher assertions.npm run build,npx tsc --noEmit,npm run lint: passed.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/pi-installed-launcher.test.ts: 1 passed. The real CLI writes the extension; a fixture Pi host loads that generated extension with PATH restricted to/usr/bin:/bin, receives project culture through the real CLI, and joins detached fixture processes before cleanup.shell: false. Reinject/pull and restart Pi after relocating Node or TeamAI, as documented in both language guides.