Repository navigation
Conversation
|
No findings in the specified PR diff. The PR description documents sufficient testing, including a built-CLI end-to-end run covering injection, listing, doctor, and uninstall in the recorded CodeBuddy home. Native Windows and additional-provider coverage deferred to CI do not block merge. Review was read-only; I did not run, build, or install anything from the PR. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@nateEc The core change works. With CODEBUDDY_CONFIG_DIR set, hooks inject writes the moved home's settings.json, uninstall --agent codebuddy removes the entries there, and WorkBuddy stays at ~/.workbuddy; a build of main writes ~/.codebuddy. The new e2e file passes here and fails on main. Three things block, all visible in CI.
[P1 blocking] A member's own MCP server in the moved CodeBuddy home is overwritten. Dropping settingsAtDefault for CodeBuddy removes the unmoved-file lookup, so when an earlier release's record exists, the team entry replaces the member's own api server in the moved mcp.json. mcp-locate-targets.test.ts (keeps a member's server in the moved CodeBuddy home that an earlier release's record, noting no file, does not own) fails at this head and passes on main; it is one of the failures in all six Lint & Test jobs.
[P1 blocking] ZCode self-mode hooks are no longer injected. The installedRoot change in src/hooks.ts applies to every tool. ZCode's hook root is always $HOME, so in self mode the guard is false and the project's copy is no longer checked. e2e/zcode-self-hooks.test.ts fails here (ENOENT on home/.zcode/cli/config.json, also in E2E shard 3/3) and passes on main; reverting that line makes it pass. A guard limited to the moved user home also keeps it green with the CodeBuddy tests passing:
const movedUserHome = toolRoot !== path.join(baseDir, gateRoot) && path.resolve(baseDir) === path.resolve(getUserHome());
const installedRoot = opts.installedBaseDir && !movedUserHome ? path.join(opts.installedBaseDir, gateRoot) : toolRoot;[P1 blocking] hooks.test.ts fails three injectHooksToAllTools cases (filterAgents limits injection…, …allows multiple agents…, undefined filterAgents…) with the readFileSafe mock error, in all six Lint & Test jobs. hookSettingsPath now calls toolHome against the real host, which those tests mock out. They pass on main.
- [P2 non-blocking] With the variable set,
uninstallnow leaves the six teamaihook-dispatchentries an earlier release wrote to~/.codebuddy/settings.json;mainremoves them. CodeBuddy does not read that file while the variable is set, and the body says the old-home file is kept on purpose, but the entries are teamai's own and would fire against a missing CLI if the member later unsets the variable. - [P2 non-blocking] #1370 adds the same per-tool branch in
hookSettingsPathand the sameinstalledRootline for Muse, and the two PRs conflict intypes.ts,local-agent.test.tsand both reference docs. One helper for "hooks follow the recorded home" would serve both, and is also the piece #1221's B4 will replace. - [P2 non-blocking] Removing the flag hides doctor's split view while
models switchstill writes~/.codebuddy/models.jsonuntil #1373 lands. - [P3 nit] The CodeBuddy comment in
tools.tsno longer matches the code.
The CI review reports no findings. We disagree: it read only the diff and did not see the red jobs. CI at this head: the six Lint & Test jobs fail on mcp-locate-targets and hooks.test.ts, and E2E shard 3/3 (and its aggregate) on zcode-self-hooks; the GitHub-provider job is skipped by the fork policy.
- 让 CodeBuddy settings.json 及安装门槛使用 CODEBUDDY_CONFIG_DIR 或机器记录的主目录,避免 hooks 写入工具不会读取的默认目录。 - 统一内置、团队与 HTTP hooks 的安装和卸载路径;保留项目与自定义路径、旧目录及个人 hook,不在已删除的移动目录中重新创建文件。 - 更新工具描述和中英参考文档,增加环境变量、记录优先级、缺失目录及 HTTP 生命周期回归;修复前 3 个目录用例失败。 - 363 个生命周期与卸载单测、97 个相关检查用例通过;构建、类型检查、lint 和真实 CLI 注入、列表、doctor、卸载验证通过。
- 将旧版默认目录 MCP 记录与当前 hooks 路径描述分离,避免覆盖成员服务器。 - 仅对迁移的用户目录禁用项目安装回退,恢复 ZCode 自模式注入。 - 补全文件系统 mock;677 项定向单测及 CodeBuddy、ZCode CLI 场景通过。
8ab4c7a to
a8a39eb
Compare
|
No findings in the specified PR diff. The earlier review also reported no findings, so there are none to mark resolved. The PR description documents sufficient testing, including a built-CLI end-to-end run covering hook injection, listing, doctor, and uninstall in the recorded CodeBuddy home. Native Windows and additional-provider coverage deferred to CI do not block merge. Review was read-only; I did not run, build, or install anything from the PR. |
|
Updated and rebased onto main Verification: 677 focused unit tests passed; types, lint and build passed. Post-build real-CLI Full unit run: 16,375 passed, 36 skipped, 3 failed. The same three failures reproduce on unchanged main fc8a229: two submodule-checkout empty legacy-file / Git hook-config cases and the workflow-pr-providers child-pipe deadline case (holder.pid missing). This is not a fully green full-suite claim; the focused regression suites above pass. Updated head: |
@nateEc Re-checked at a8a39eb. All three earlier blockers are fixed, and CI is green at this head:
The
The CI review is right that this head has no new findings in the diff. Its statement that the earlier review had none is not right: our review at 8ab4c7a had three blocking findings. |
…use and CodeBuddy Each test records a moved home, then runs pull or hooks inject, hooks list and hooks remove through the built CLI with the variable unset, so the recorded home alone decides where the hooks go. The OpenCode case also checks that the plugin reads the user context from the moved home. All four fail on main and pass here. They come from #1368, #1369, #1370 and #1371, which this branch replaces. Co-authored-by: Nathan Shan <[email protected]>
…use and CodeBuddy Each test records a moved home, then runs pull or hooks inject, hooks list and hooks remove through the built CLI with the variable unset, so the recorded home alone decides where the hooks go. The OpenCode case also checks that the plugin reads the user context from the moved home. All four fail on main and pass here. They come from Tencent#1368, Tencent#1369, Tencent#1370 and Tencent#1371, which this branch replaces. Co-authored-by: Nathan Shan <[email protected]>
…ollow a moved home (#1221) (#1405) * feat(tools): state every tool's hook channel in the descriptor (#1221) Each built-in tool now names, for the user scope and for self mode, how teamai installs its hooks: entries in a settings file with the shape of its hook list, a file of teamai's own its adapter writes (OpenCode's plugin, Pi's and OMP's extension, Hermes, OpenClaw, dsh), 'none' or 'unknown'. Leaving it out fails tsc (tools.type-test.ts). hooks.ts takes each tool's hook shape from the descriptor (hookFormatOf) instead of its own tool sets; a test pins it to the table it replaced. * feat(locate): locate each tool's hooks from the descriptor (#1221) locate(tool, 'hooks') answers with the hook list of the tool's hook file, in its shape, or the directory its adapter writes teamai's file into. A workspace takes the user hooks; self mode takes the project's, except for a tool that reads its user hooks there too (ZCode's CLI, every adapter). A user hook file follows the tool's moved home, and the default home's is retired for the four tools whose earlier releases wrote there. hookSettingsFile and hookAdapterDir give the writers the same answer. No writer uses them yet. The matrix states every tool in the user scope, a workspace and self mode, with the moved homes. * fix(hooks): write and remove hooks where locate says the tool reads them (#1221) Hook writers took a fixed default-home path, so a tool whose home moved (CODEBUDDY_CONFIG_DIR, CODEX_HOME, OPENCODE_CONFIG_DIR, XDG_CONFIG_HOME, PI_CODING_AGENT_DIR) got hooks in a file it never reads. Settings writers now take the file from hookSettingsFile, and the Pi, OMP, OpenCode and dsh adapters take their directory from hookAdapterDir; both sit beside locate's hooks resolver and share its toolHome. Uninstall checks the moved file and the default-home copy earlier releases wrote, and the OpenCode and Pi adapter dirs locate retires. Pull leaves the default-home copy in place, as it does for skills; the tool does not read it. * fix(doctor): drop the note that teamai writes under a tool's default home (#1221) Hooks now follow a moved home, so nothing teamai writes for Pi, CodeBuddy, OpenCode or Muse stays under the default one, and doctor's "still writes some of its other files under" notes were wrong. The descriptor flag behind them is renamed to defaultHomeLeftovers: it now only says where earlier releases left hooks and MCP servers, which uninstall and MCP ownership still look for. * fix(hooks): hooks remove also clears the default-home hooks an earlier release wrote (#1221) A tool reads its default home again once the member unsets the variable that moved it, so the hooks an earlier release left there would fire after `hooks remove`. It now sweeps the places locate retires: the settings file, with the team's hook history to find team entries whose records went with the moved copy, and the OpenCode plugin and Pi extension directories. The e2e test runs the real CLI with CODEBUDDY_CONFIG_DIR and XDG_CONFIG_HOME set: hooks inject writes the moved homes, and uninstall and hooks remove clear both copies. * docs: hooks follow a moved OpenCode, Muse, Pi and CodeBuddy home (#1221) * fix(hooks): clear the default-home copy first, so one team-hook record covers both copies (#1221) A Muse team hook carries no marker, so only its manifest record names it, and an HTTP-backed team has no hook history to fall back on. Cleaning the moved file first consumed that record and left the team hook in the default-home copy. That copy now goes first with keepRecords, and the moved file's pass consumes the records. * refactor(hooks): key HOME-hook ownership on the descriptor's self channel, not on ZCode (#1221) A project install of a tool that keeps its user hooks reads them from HOME, so it owns only its gated team hooks there. reconcileHooksToAllTools and uninstall's HOME target named ZCode for this; they now read hooks.self === 'user', as hookSettingsFile already does. * fix(hooks): pull removes the OpenCode plugin an earlier release left in the default home (#1221) OpenCode 1.x loads the default config dir's plugins beside OPENCODE_CONFIG_DIR's and dedupes them by file URL, so the copy an earlier release wrote there and the moved one both ran, firing every event twice. Pull already deletes a project-scope copy for the same reason. * fix(hooks): an agent hook leaves no copy in a moved tool's default home (#1221) Withdrawing an OpenCode or Pi agent hook removed only the moved copy, so the one an earlier release wrote under the default home ran again once the home stopped moving. Removal now clears both. Writing an OpenCode agent hook also removes the earlier copy, which OpenCode 1.x loads beside the moved one. * fix(hooks): keep a moved tool's hooks and records when a copy is the same or fails (#1221) A default home linked to the moved one is the same directory, so pull no longer deletes the plugin it just wrote through the link. And when the default-home copy cannot be cleaned, the moved copy's pass leaves the records, so a retry after repairing the file still finds the team hook. * fix(hooks): pull removes the hooks an earlier release left in a moved tool's default home (#1221) The default-home copy was left as it was, so once the team changed a hook, the moved file's pass replaced its record and the old Muse team hook stayed in that copy with nothing to name it for removal. Pull now clears the copy first, judged by the records the moved pass then replaces, for CodeBuddy and Muse settings and Pi's extension as already for OpenCode's plugin. A copy that is the moved file through a link is left alone. * fix(hooks): keep a moved tool's hooks and records when its default-home copy cannot be cleaned (#1221) * fix(models): models switch writes into the Claude and Codex roots teamai init recorded (#1221) * fix(hooks): hooks remove exits 1 when it leaves hooks behind, as uninstall does (#1221) * fix(hooks): write settings and agent hooks only through a channel the tool reads (#1221) * test(hooks): cover recorded tool homes end to end for Pi, OpenCode, Muse and CodeBuddy Each test records a moved home, then runs pull or hooks inject, hooks list and hooks remove through the built CLI with the variable unset, so the recorded home alone decides where the hooks go. The OpenCode case also checks that the plugin reads the user context from the moved home. All four fail on main and pass here. They come from #1368, #1369, #1370 and #1371, which this branch replaces. Co-authored-by: Nathan Shan <[email protected]> * feat(tools): state Kiro's standalone hook file as its hook channel (#1221) #1341 moved Kiro's session-start hook to ~/.kiro/hooks/teamai.json, which Kiro CLI V3 loads for every agent. The descriptor still said Kiro takes no hooks. It now names the file as a hook adapter, and kiroHookFile takes its directory from locate, as the other adapters do. --------- Co-authored-by: Nathan Shan <[email protected]>
…ollow a moved home (Tencent#1221) (Tencent#1405) * feat(tools): state every tool's hook channel in the descriptor (Tencent#1221) Each built-in tool now names, for the user scope and for self mode, how teamai installs its hooks: entries in a settings file with the shape of its hook list, a file of teamai's own its adapter writes (OpenCode's plugin, Pi's and OMP's extension, Hermes, OpenClaw, dsh), 'none' or 'unknown'. Leaving it out fails tsc (tools.type-test.ts). hooks.ts takes each tool's hook shape from the descriptor (hookFormatOf) instead of its own tool sets; a test pins it to the table it replaced. * feat(locate): locate each tool's hooks from the descriptor (Tencent#1221) locate(tool, 'hooks') answers with the hook list of the tool's hook file, in its shape, or the directory its adapter writes teamai's file into. A workspace takes the user hooks; self mode takes the project's, except for a tool that reads its user hooks there too (ZCode's CLI, every adapter). A user hook file follows the tool's moved home, and the default home's is retired for the four tools whose earlier releases wrote there. hookSettingsFile and hookAdapterDir give the writers the same answer. No writer uses them yet. The matrix states every tool in the user scope, a workspace and self mode, with the moved homes. * fix(hooks): write and remove hooks where locate says the tool reads them (Tencent#1221) Hook writers took a fixed default-home path, so a tool whose home moved (CODEBUDDY_CONFIG_DIR, CODEX_HOME, OPENCODE_CONFIG_DIR, XDG_CONFIG_HOME, PI_CODING_AGENT_DIR) got hooks in a file it never reads. Settings writers now take the file from hookSettingsFile, and the Pi, OMP, OpenCode and dsh adapters take their directory from hookAdapterDir; both sit beside locate's hooks resolver and share its toolHome. Uninstall checks the moved file and the default-home copy earlier releases wrote, and the OpenCode and Pi adapter dirs locate retires. Pull leaves the default-home copy in place, as it does for skills; the tool does not read it. * fix(doctor): drop the note that teamai writes under a tool's default home (Tencent#1221) Hooks now follow a moved home, so nothing teamai writes for Pi, CodeBuddy, OpenCode or Muse stays under the default one, and doctor's "still writes some of its other files under" notes were wrong. The descriptor flag behind them is renamed to defaultHomeLeftovers: it now only says where earlier releases left hooks and MCP servers, which uninstall and MCP ownership still look for. * fix(hooks): hooks remove also clears the default-home hooks an earlier release wrote (Tencent#1221) A tool reads its default home again once the member unsets the variable that moved it, so the hooks an earlier release left there would fire after `hooks remove`. It now sweeps the places locate retires: the settings file, with the team's hook history to find team entries whose records went with the moved copy, and the OpenCode plugin and Pi extension directories. The e2e test runs the real CLI with CODEBUDDY_CONFIG_DIR and XDG_CONFIG_HOME set: hooks inject writes the moved homes, and uninstall and hooks remove clear both copies. * docs: hooks follow a moved OpenCode, Muse, Pi and CodeBuddy home (Tencent#1221) * fix(hooks): clear the default-home copy first, so one team-hook record covers both copies (Tencent#1221) A Muse team hook carries no marker, so only its manifest record names it, and an HTTP-backed team has no hook history to fall back on. Cleaning the moved file first consumed that record and left the team hook in the default-home copy. That copy now goes first with keepRecords, and the moved file's pass consumes the records. * refactor(hooks): key HOME-hook ownership on the descriptor's self channel, not on ZCode (Tencent#1221) A project install of a tool that keeps its user hooks reads them from HOME, so it owns only its gated team hooks there. reconcileHooksToAllTools and uninstall's HOME target named ZCode for this; they now read hooks.self === 'user', as hookSettingsFile already does. * fix(hooks): pull removes the OpenCode plugin an earlier release left in the default home (Tencent#1221) OpenCode 1.x loads the default config dir's plugins beside OPENCODE_CONFIG_DIR's and dedupes them by file URL, so the copy an earlier release wrote there and the moved one both ran, firing every event twice. Pull already deletes a project-scope copy for the same reason. * fix(hooks): an agent hook leaves no copy in a moved tool's default home (Tencent#1221) Withdrawing an OpenCode or Pi agent hook removed only the moved copy, so the one an earlier release wrote under the default home ran again once the home stopped moving. Removal now clears both. Writing an OpenCode agent hook also removes the earlier copy, which OpenCode 1.x loads beside the moved one. * fix(hooks): keep a moved tool's hooks and records when a copy is the same or fails (Tencent#1221) A default home linked to the moved one is the same directory, so pull no longer deletes the plugin it just wrote through the link. And when the default-home copy cannot be cleaned, the moved copy's pass leaves the records, so a retry after repairing the file still finds the team hook. * fix(hooks): pull removes the hooks an earlier release left in a moved tool's default home (Tencent#1221) The default-home copy was left as it was, so once the team changed a hook, the moved file's pass replaced its record and the old Muse team hook stayed in that copy with nothing to name it for removal. Pull now clears the copy first, judged by the records the moved pass then replaces, for CodeBuddy and Muse settings and Pi's extension as already for OpenCode's plugin. A copy that is the moved file through a link is left alone. * fix(hooks): keep a moved tool's hooks and records when its default-home copy cannot be cleaned (Tencent#1221) * fix(models): models switch writes into the Claude and Codex roots teamai init recorded (Tencent#1221) * fix(hooks): hooks remove exits 1 when it leaves hooks behind, as uninstall does (Tencent#1221) * fix(hooks): write settings and agent hooks only through a channel the tool reads (Tencent#1221) * test(hooks): cover recorded tool homes end to end for Pi, OpenCode, Muse and CodeBuddy Each test records a moved home, then runs pull or hooks inject, hooks list and hooks remove through the built CLI with the variable unset, so the recorded home alone decides where the hooks go. The OpenCode case also checks that the plugin reads the user context from the moved home. All four fail on main and pass here. They come from Tencent#1368, Tencent#1369, Tencent#1370 and Tencent#1371, which this branch replaces. Co-authored-by: Nathan Shan <[email protected]> * feat(tools): state Kiro's standalone hook file as its hook channel (Tencent#1221) Tencent#1341 moved Kiro's session-start hook to ~/.kiro/hooks/teamai.json, which Kiro CLI V3 loads for every agent. The descriptor still said Kiro takes no hooks. It now names the file as a hook adapter, and kiroHookFile takes its directory from locate, as the other adapters do. --------- Co-authored-by: Nathan Shan <[email protected]>
With
CODEBUDDY_CONFIG_DIR(or a persisted tool home), CodeBuddy loads a different settings.json while TeamAI still installs hooks under~/.codebuddy. Pull can appear successful without any of those hooks running.Use the same recorded-home resolver for hook installation, HTTP hooks, listing and teardown. Keep project/self and custom settings paths, personal hooks and the old-home file. Check the actual moved directory before installing, rather than allowing an old/project directory to recreate it. Update the descriptor and bilingual directory reference.
Review follow-up:
Preserve legacy MCP ownership independently of current hook paths, narrow the moved-home installation guard to user scope (restoring ZCode self hooks), and complete the existing hooks test filesystem mock. CodeBuddy model routing is already merged in #1373. Old-home hook entries are deliberately retained because other installations/scopes may still use them; remove only TeamAI entries there after those readers are retired.
Validation on this branch, rebased onto
fc8a229e:npx tsc --noEmit,npm run lint,npm run build,git diff --check: passed.npx vitest run src/__tests__/hooks.test.ts src/__tests__/mcp-locate-targets.test.ts src/__tests__/uninstall.test.ts src/__tests__/local-agent.test.ts src/__tests__/codebuddy-relocated-hooks.test.ts src/__tests__/tools-channels.test.ts src/__tests__/doctor-delivery.test.ts: 677 passed.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/codebuddy-relocated-hooks.test.ts src/__tests__/e2e/zcode-self-hooks.test.ts: 2 passed, using the real CLI and isolated local Git/HOME fixtures.Full unit run: 16,375 passed, 36 skipped, 3 failed. The same three failures reproduce on unchanged main fc8a229: two submodule-checkout empty legacy-file / Git hook-config cases and the workflow-pr-providers child-pipe deadline case (holder.pid missing). This is not a fully green full-suite claim; the focused regression suites above pass.
Local host: macOS, Node 22.22.1, Apple Git 2.50.1. Native Windows, live vendor applications and additional provider combinations were not run locally and are left to CI. This record replaces the earlier combined-snapshot validation paragraphs.
Refs #1221; this PR addresses only its stated independent defect.