feat(plugins): add goal lifecycle hooks#27790
Open
clicheman wants to merge 1 commit into
Open
Conversation
Expose four new fire-and-forget hooks fired by GoalManager when the /goal state machine transitions: on_goal_set - new goal created on_goal_pause - goal paused (user, judge parse failure, etc.) on_goal_resume - goal resumed on_goal_complete - goal marked done Plugin callbacks are observers; return values are ignored and exceptions are caught so a misbehaving plugin can't wedge the goal mutation that fired the hook. Adds VALID_HOOKS entries, synthetic _DEFAULT_PAYLOADS for `hermes plugins test`, and 7 tests covering each hook payload plus the error-isolation contract. Closes NousResearch#27777
19 tasks
Contributor
|
Thanks for adding this hook surface — the underlying gap is still real on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
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.
Summary
Add four new fire-and-forget plugin hooks fired by
GoalManagerwhen the/goalstate machine transitions:on_goal_setsession_id,goal_text,max_turnson_goal_pausesession_id,reasonon_goal_resumesession_id,reset_budgeton_goal_completesession_id,reason,turns_usedPlugin callbacks are observers — return values are ignored, and any exception raised inside a callback is swallowed (logged at DEBUG) so a misbehaving plugin cannot wedge the goal mutation that fired the hook. Consistent with the existing hook contract used by
pre_api_requestetc.Changes
hermes_cli/plugins.py— add the four hook names toVALID_HOOKShermes_cli/hooks.py— add synthetic_DEFAULT_PAYLOADSentries sohermes plugins test on_goal_set(and friends) workhermes_cli/goals.py— new_fire_goal_hook()helper invoked fromset(),pause(),resume(), andmark_done()tests/hermes_cli/test_goals.py— newTestGoalLifecycleHooksclass with 7 tests covering each hook payload, no-op on inactive state, and the error-isolation contractTests
No existing tests had to be modified — this is a pure addition.
Closes #27777