[Bug]: Plugin-registered internal hooks are cleared during gateway startup#13709
[Bug]: Plugin-registered internal hooks are cleared during gateway startup#13709ramarnat wants to merge 1608 commits intoopenclaw:mainfrom
Conversation
bfc1ccb to
f92900f
Compare
…claw#18660) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: ba54c5a Co-authored-by: robbyczgw-cla <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…openclaw#19609) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 10d9df5 Co-authored-by: gumadeiras <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
27 similar comments
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated commits). Please recreate the PR from a clean branch. |
…ation Upstream-Status: Pending Upstream-PR: openclaw#13709
Summary
Plugins that register internal hooks during plugin registration (e.g. session:start) lose those hooks when the gateway later loads file-based hooks. The gateway clears internal hooks during startup after plugin registration, wiping plugin-registered hooks.
Steps to reproduce
Expected behavior
Plugin-registered internal hooks should remain registered after internal hooks are loaded.
Actual behavior
Plugin-registered internal hooks are cleared and do not fire.
Environment
Notes / Why
The gateway clears internal hooks during startGatewaySidecars after plugin registration. Fix is to clear before plugins register hooks and keep hook discovery additive. (Branch: pr/internal-hooks-clear-before-plugins includes fix + regression test.)
Greptile Overview
Greptile Summary
This PR fixes a bug where plugins that registered internal hooks during initialization (e.g.,
session:start) would lose those hooks when the gateway later loaded file-based hooks. The root cause was thatclearInternalHooks()was being called instartGatewaySidecarsafter plugins had already registered their hooks.Key Changes:
clearInternalHooks()call fromserver-startup.ts:99(after plugins load) toserver.impl.ts:234(before plugins load)loadInternalHooks()callHow it works:
server.impl.ts:234)api.registerHook()(server.impl.ts:235)startGatewaySidecars()loads file-based hooks additively without clearing (server-startup.ts:101)The fix ensures hook discovery is additive rather than destructive, preserving all hooks regardless of registration source.
Confidence Score: 5/5
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!