fix(doctor): probe the Copilot hooks file where inject writes it - #733
Merged
jeff-r2026 merged 1 commit intoSep 23, 2026
Merged
Conversation
…cent#732) In a non-self project scope, resolveDoctorContext forces the hook paths to the hook scope ('user', per resolveHookScope) so settings-based hooks are probed where reconcileHooksToAllTools writes them. The standalone Copilot hooks file is written by reconcileTeamHooksForConfig at the config's own scope instead, so the doctor ended up joining the userScope relative path (hooks/teamai.json) onto <projectRoot> and reported Copilot missing right after a successful `hooks inject`. buildHookChecks now takes both maps and picks per hook kind: a standalone `hooks` file from the config-scoped paths, `settings` from the hook-scoped ones. Same rule `hooks list` already applies. Hypothesis confirmed: scope mismatch between the two path maps, introduced when Tencent#695 moved the doctor's hook paths to the hook scope for Qoder CN.
Merged
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #732
Summary
doctorandinjectresolved the Copilot hooks file to two different paths in a non-self project scope.injectwrites it at the config scope;doctorjoined the user-scope relative path onto the project base dir.hooks listalready applied this rule (hooks-cmd.ts,hookScopedPaths[tool]?.settings);doctornow matches it. Note for #728: it adds the same parameter tobuildHookChecksas part oftoolRoots; the two will need a trivial rebase.Evidence
Before: new test
checks project Copilot hooks where inject wrote them when userScope.hooks is set(project scope,toolPaths.copilotwith bothhooksanduserScope.hooks, file present at<projectRoot>/.github/hooks/teamai.json):After: passes.
npx vitest run→ 271 files, 3875 passed, 1 skipped.npx tsc --noEmitclean.Before (real CLI,
mainatcd3e0e6, project scope, Copilot installed):teamai hooks inject→✔ Hooks injected into all AI tool settings;doctorstill ✖.After (
npm run build, same config):Test Plan
npx tsc --noEmitnpx vitest run(271 files, 3875 passed)npm run buildthenteamai doctorin a project-scope install (providergithub) with Claude, Codex, Cursor, Copilot and CodeBuddy hooks injected: all five hook checks ✔teamai hooks list:copilot installed <project>/.github/hooks/teamai.json, consistent withdoctorchecks standalone Copilot hooks under COPILOT_HOME) still green:$COPILOT_HOME/hooks/teamai.jsonunchangedMerge Danger
Door: two-way
Read-only check; revert restores the previous probe path. No file is written.
Blast Radius: doctor
Only the Copilot row of the hook checks changes its path, and only when
userScope.hooksdiffers fromhooksin a non-self project scope. Settings-based tools keep the hook-scope path from #695. Also affects the post-pull check registry, which sharesbuildChecks.