Hi, I am struggling with hooks. I have a docker co...
# questions
b
Hi, I am struggling with hooks. I have a docker container running the backend (1.27.1), within the workspace directory I have the hooks.json and its related scripts (as explained docs.openhands.dev/openhands/usage/customization/hooks). The frontend is running externally (same version). I can successfully initiate conversations, but hooks seems to be never fired : • There are no logs from the scripts • The output of the container does not mention any hooks • In the "Show available hooks" menu from the conversation there is nothing I see that the SDK offers another implementation, but before exploring it, how can I investigate or fix the current setup? I really appreciate your help.
👀 1
🙌 1
c
We just fixed a couple bugs with this, but I think they should be in 1.27.1 🤔 Could you tell, are you starting the conversation using a workspace folder? I mean this detail here
Without a workspace
The path should be (dir) / .openhands / hooks.json
b
Thanks. I was in the usecase where I do not select a specific workspace, and my hooks config was under /home/openhands/workspace/.openhands directly instead of /home/openhands/workspace/project/.openhands. I misinterpreted, how to put hooks in the workspace folder. Thanks a lot, it works
c
Great to hear! Mmm I wonder how could we make it clear… something feels counterintuitive about in the current behavior, doesn’t it?
b
I would suggest to be explicit in the online documentation, like:
Copy code
in the GUI, if you select a Working folder to start a conversation through "Open Workspace", the hooks are expected to be in the selected folder under a subfolder .openhands. If you dont, the hooks shall be in the default working directory "/home/openhands/workspace/project/.openhands"
✅ 1
c
@bland-bear-604 please open a PR to docs with the clarification
🐾 1
b
Opened docs PR #941 as smolpaws 🐾 It clarifies the selected/default working folder, the backend-side Docker path, and that hooks discovery doesn’t search parent folders.