fix(scripts): update copy-hook-metadata script to correct destination…#43223
Open
saurav470 wants to merge 1 commit intoopenclaw:mainfrom
Open
fix(scripts): update copy-hook-metadata script to correct destination…#43223saurav470 wants to merge 1 commit intoopenclaw:mainfrom
saurav470 wants to merge 1 commit intoopenclaw:mainfrom
Conversation
… path for HOOK.md files
Contributor
Greptile SummaryThis PR fixes a regression where globally-installed
Confidence Score: 5/5
Last reviewed commit: f5fbd2b |
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.
Fixes #43180
Problem
After installing OpenClaw globally (e.g. pnpm add -g openclaw@latest on Windows), openclaw hooks list showed "No hooks found" and openclaw hooks enable session-memory failed with Error: Hook "session-memory" not found. This is a regression: bundled hooks used to be discoverable.
Root cause
Path mismatch between build and runtime:
Runtime (src/hooks/bundled-dir.ts): resolveBundledHooksDir() resolves the directory of the compiled bundled-dir.js and appends "bundled". For a global install that is .../openclaw/dist/hooks/bundled-dir.js, so it looks for dist/hooks/bundled.
Build (scripts/copy-hook-metadata.ts): HOOK.md files were copied to dist/bundled, so the runtime never saw them.
Change
scripts/copy-hook-metadata.ts: Copy destination changed from dist/bundled to dist/hooks/bundled so HOOK.md files sit next to the compiled handlers and match what resolveBundledHooksDir() expects. Comment updated to reference that resolutio