Summary
The /goal system has a complete state machine (set → evaluate → pause → resume → complete), but this lifecycle is completely invisible to the plugin system. While Hermes exposes hook points for sessions (on_session_start/end), LLM calls (pre/post_llm_call), and API requests (pre/post_api_request), there is no way for a plugin to observe or react to goal lifecycle events.
This makes it impossible for plugins to:
Proposed Hooks
| Hook |
Trigger |
Payload |
on_goal_set |
User sets a new goal |
goal_text, max_turns, session_id |
on_goal_pause |
Goal auto-pauses (API error / parse failure / timeout) |
reason, state_snapshot |
on_goal_resume |
Goal resumes execution |
reset_budget, state_snapshot |
on_goal_complete |
Goal is achieved |
turns_used, summary |
Benefits
- Observability: Plugins can track goal progress in external systems (Langfuse, PostHog, etc.)
- Notifications: Goal auto-pauses can trigger user notifications beyond terminal output
- Extensibility: Third-party plugins can implement custom goal judges, completion alerts, or analytics
Implementation Notes
- All new hooks should be fire-and-forget (no return value modification), consistent with the existing hook contract
- Hook invocation points in
hermes_cli/goals.py: set(), pause(), resume(), judge_goal()
- No breaking changes — existing behavior is preserved
- The internal
goal continuation hook in cli.py/gateway/run.py is an internal implementation detail; this proposal adds the plugin-visible hook layer
Related
Summary
The
/goalsystem has a complete state machine (set → evaluate → pause → resume → complete), but this lifecycle is completely invisible to the plugin system. While Hermes exposes hook points for sessions (on_session_start/end), LLM calls (pre/post_llm_call), and API requests (pre/post_api_request), there is no way for a plugin to observe or react to goal lifecycle events.This makes it impossible for plugins to:
Proposed Hooks
on_goal_setgoal_text,max_turns,session_idon_goal_pausereason,state_snapshoton_goal_resumereset_budget,state_snapshoton_goal_completeturns_used,summaryBenefits
Implementation Notes
hermes_cli/goals.py:set(),pause(),resume(),judge_goal()goal continuation hookincli.py/gateway/run.pyis an internal implementation detail; this proposal adds the plugin-visible hook layerRelated
on_goal_pausehook for notification)agent/conversation_loop.py— Contains all existing_invoke_hook()calls for reference pattern