fix(plugins): load explicit hook plugins at startup#76684
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Source inspection shows current main can load embedded PI runtime plugins from Next step before merge Security Review detailsBest possible solution: Review and land the generic hook-aware startup planner change, preserving plugin enable, deny, and allowlist gates without Feishu-specific behavior or hardcoded plugin IDs. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main can load embedded PI runtime plugins from Is this the best way to solve the issue? Yes. The PR fixes the implicated planner layer generically and adds tests for hook intent plus enable/deny/allowlist gates, which is narrower than a Feishu-specific workaround. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 103b6d50a5b6. |
|
The branch conflict has been resolved and the PR is now mergeable against |
0ad8b11 to
25977de
Compare
…(thanks @MkDev11) Includes explicitly enabled hook-capable plugins in the Gateway startup runtime scope and adds regression coverage for startup hook plugin gating.
…(thanks @MkDev11) Includes explicitly enabled hook-capable plugins in the Gateway startup runtime scope and adds regression coverage for startup hook plugin gating.
…(thanks @MkDev11) Includes explicitly enabled hook-capable plugins in the Gateway startup runtime scope and adds regression coverage for startup hook plugin gating.
…(thanks @MkDev11) Includes explicitly enabled hook-capable plugins in the Gateway startup runtime scope and adds regression coverage for startup hook plugin gating.
…(thanks @MkDev11) Includes explicitly enabled hook-capable plugins in the Gateway startup runtime scope and adds regression coverage for startup hook plugin gating.
Summary
before_prompt_buildoragent_endcould work in harness runtimes while remaining invisible to Feishu/main embedded PI runs.Change Type
Scope
Linked Issue/PR
Root Cause
startup.pluginIds, so embedded PI read a global hook runner without those plugin hooks.Regression Test Plan
src/plugins/channel-plugin-ids.test.tsUser-visible / Behavior Changes
External hook plugins configured for agent lifecycle hooks are available to embedded PI runs.
Diagram
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
allowPromptInjectionandallowConversationAccessSteps
Expected
Actual
Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
activation.onCapabilities: ["hook"]plugins.entries.<id>.hooks.allowPromptInjection=trueplugins.entries.<id>.hooks.allowConversationAccess=trueTest Plan
pnpm exec vitest run --config test/vitest/vitest.plugins.config.ts src/plugins/channel-plugin-ids.test.ts -t "loads explicit hook"-> PASSpnpm test src/agents/runtime-plugins.test.ts src/plugins/loader.test.ts src/agents/pi-embedded-runner/run/attempt.test.ts src/plugins/channel-plugin-ids.test.ts-> PASSpnpm exec oxfmt --check --threads=1 src/plugins/gateway-startup-plugin-ids.ts src/plugins/channel-plugin-ids.test.ts CHANGELOG.md-> PASSpnpm check:changed-> PASS