Skip to content

fix(omp): launch extension callbacks through the installed CLI - #1372

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
nateEc:fix/1221-omp-installed-launcher
Oct 25, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
nateEc:fix/1221-omp-installed-launcher

Conversation

@nateEc

@nateEc nateEc commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

OMP's generated extension still launched teamai by name for both lifecycle dispatch and instruction loading. A host without the npm/global bin directory on PATH silently lost hooks and project context.

Capture the installed Node executable and CLI entry in the generated extension and pass them as a Bun shell argument array for both paths. Preserve payloads, attribution, timeouts and swallowed hook failures. Adjust the unit-only extension harness for the added launcher argument.

Refs #1221 (host launcher/path delivery gaps). This is OMP-specific; the Pi/Hermes fixes in #1365/#1367 do not change this extension.

Validation:

  • New runtime regression failed before the fix: no context was returned when PATH was empty.
  • npx vitest run src/__tests__/omp-installed-launcher.test.ts src/__tests__/omp-hooks.test.ts — 27 passed, including real child processes and an installed CLI path containing spaces.
  • src/__tests__/recall-attribution.test.ts — 162 passed with the updated OMP shell contract harness.
  • npx tsc --noEmit, npm run lint, npm run build — passed.
  • Real built CLI: npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/omp-installed-launcher.test.ts — passed. A scratch git-team pull installs the extension; its callbacks launch the real CLI and retrieve project culture with teamai absent from PATH. The committed test replaces only Bun's shell API with an argv-preserving Node subprocess adapter so CI needs no Bun install.
  • Additional local run under real Bun 1.4.0, using the same built-CLI fixture and the unmodified generated extension — passed with PATH /usr/bin:/bin, returning the project culture and original prompt. No live OMP/model session was started.

No provider matrix or native Windows desktop session was exercised locally.

- 在生成的 OMP 扩展中保存绝对 Node 路径和 CLI 入口,生命周期分发及项目指令读取均通过 Bun 的参数数组启动。
- 保持 stdin 载荷、会话归属和非阻断行为;安装路径包含空格或宿主 PATH 中没有 teamai 时仍能调用正确的 CLI。
- 添加实际子进程回归和真实 CLI 安装后的扩展验证,并同步既有扩展测试替身的调用约定;修复前无法取得上下文。
- 27 个启动与扩展单测及 162 个采纳归属单测通过;构建、类型检查、lint、真实 CLI E2E 和本机 Bun 1.4.0 离线验证通过。
@github-actions

Copy link
Copy Markdown

No findings in the specified PR diff.

The PR description documents sufficient testing: a built-CLI end-to-end run and a separate real-Bun run verify instruction loading without teamai on PATH. The untested provider/agent matrix and native Windows session are explicitly disclosed and are not blocking.

Review was read-only; no PR code was run, built, or installed.

@jeff-r2026 jeff-r2026 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jeff-r2026
jeff-r2026 merged commit d41d29d into Tencent:main Oct 25, 2026
18 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
- 在生成的 OMP 扩展中保存绝对 Node 路径和 CLI 入口,生命周期分发及项目指令读取均通过 Bun 的参数数组启动。
- 保持 stdin 载荷、会话归属和非阻断行为;安装路径包含空格或宿主 PATH 中没有 teamai 时仍能调用正确的 CLI。
- 添加实际子进程回归和真实 CLI 安装后的扩展验证,并同步既有扩展测试替身的调用约定;修复前无法取得上下文。
- 27 个启动与扩展单测及 162 个采纳归属单测通过;构建、类型检查、lint、真实 CLI E2E 和本机 Bun 1.4.0 离线验证通过。
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.

2 participants