fix(copilot): activate project plugin hooks - #445
Merged
Conversation
Deploying allagents with
|
| Latest commit: |
298d285
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://016cca5e.allagents.pages.dev |
| Branch Preview URL: | https://fix-copilot-project-hooks.allagents.pages.dev |
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.
Summary
Project-scoped Copilot plugin installs now activate declared hooks instead of only copying their scripts. AllAgents materializes plugin
hooks.json/hooks/hooks.jsondeclarations into one owned.github/hooks/allagents.json, binds each entry to its plugin-specificCOPILOT_PLUGIN_ROOT, and reconciles multiple plugins without touching sibling user hook files.File-mode project overlays also omit package-only
.github/plugin/metadata. Plugin exclusions remain authoritative: an excluded declaration or hook payload is not activated through the generated file.Hook translation is independent of marketplace registration and package metadata. Direct local and GitHub plugin sources do not require a marketplace manifest or
plugin.json. A missing declaration—or a declaration withdisableAllHooks: true—adds no managed entries while the plugin's other eligible artifacts continue syncing.AllAgents warns and omits a hook declaration that cannot be read or parsed as JSON or lacks the version-1
hooksobject envelope. Unless the declaration is disabled, a non-array event value also warns and omits that declaration as a unit. This does not reject the plugin or suppress valid declarations from other plugins. The exact ownership, validation, exclusion, and compatibility boundaries are recorded indocs/decisions/0001-project-plugin-hooks.md.This closes the gap between Copilot's two discovery modes: installed native plugins load declarations from the plugin directory, while repositories load
.github/hooks/*.json. See the GitHub Copilot hooks reference.WTG.AI.Prompts validation
Validated against WiseTechGlobal/WTG.AI.Prompts commit
6f36ea718dcbusing the built CLI:The generated file contained six entries across five event types: two
SessionStartentries plusUserPromptSubmit,PostToolUse,PostToolUseFailure, andSessionEnd. Both plugin roots were present,.github/plugin/plugin.jsonwas absent, and sync state owned.github/hooks/allagents.json.Reconciliation was exercised with:
Uninstall removed only
orgentries and preserved skill-usage metrics. Reinstall restored both roots and all six entries. Offline workspace update regenerated the same hook file.Live execution used Copilot CLI 1.0.70 with an isolated home and instrumented
bash/pwshwrappers:Copilot displayed
Loading: 8 hooksand attributedUserPromptSubmitto.github/hooks/allagents.json. WTG'sorg/hooks/emit-advisory.shandorg/hooks/resolve-context.shexecuted. The expectedorgandskill-usage-metricsPowerShell command paths were resolved and invoked; the host has nopwsh, so a shim recorded those invocations rather than executing the PowerShell bodies.Compatibility regression coverage
The regression tests now explicitly verify both boundaries discussed in review:
Automated validation
COPILOT_PLUGIN_ROOTwording; the final documentation now matches runtime behavior.Related follow-up
Project-scoped
plugin updatelookup is intentionally outside this hook PR and is fixed separately by the still-open, green #446. User/global marketplace update behavior was already unaffected. Until #446 merges, dedicated project-scoped plugin update can still reportMarketplace not found; install, uninstall, reinstall, andupdate --offlinevalidation for this PR passed.Related: WiseTechGlobal/mcp-ediprod#467, #442, #443
Post-Deploy Monitoring & Validation
During the first release window, exercise a project-scoped WTG install and search CLI output for
Copilot hooks:warnings. Healthy signals are an owned.github/hooks/allagents.json, the expected plugin roots/events, and Copilot reporting the loaded hooks. Missing generated state, an ownership warning on a fresh workspace, or absent WTG hook invocations is the rollback trigger; revert this PR while preserving user-owned hook files. Validation window: first release candidate and first downstream WTG install. Owner: AllAgents maintainer.