Skip to content

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

@stig

Description

@stig

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions