eca icon indicating copy to clipboard operation
eca copied to clipboard

Plugin hooks not fired for chatStart/chatEnd (timing issue)

Open stig opened this issue 8 months ago • 1 comments

Summary

Hooks defined by plugins (via hooks.json in the plugin directory) do not fire for chatStart and chatEnd event types. Hooks from the same plugins using other event types (e.g. postRequest, preToolCall) work fine.

Hooks defined directly in config.json with chatStart type do fire correctly.

Reproduction

  1. Install the session-journal plugin which registers chatStart and chatEnd hooks
  2. Start a new chat
  3. Observe that the plugin's hooks are never executed

Workaround: define the hooks directly in config.json instead of relying on the plugin's hooks.json.

Likely cause

chatStart fires before plugin hooks are registered during initialization. Plugins that use postRequest or preToolCall work because those events fire later in the lifecycle, after plugins have been fully loaded.

Environment

  • Tested with the session-journal and notify-hooks plugins
  • notify-hooks (postRequest/preToolCall) works; session-journal (chatStart/chatEnd) does not
  • Hooks with identical structure in config.json work for all event types

stig avatar Mar 25 '26 13:03 stig

done, available in the next reelase, LMK if any issues

ericdallo avatar Mar 26 '26 12:03 ericdallo