fix(plugins): rename per-turn hook from on_session_end to on_turn_end - #26509
Closed
beardthelion wants to merge 1 commit into
Closed
fix(plugins): rename per-turn hook from on_session_end to on_turn_end#26509beardthelion wants to merge 1 commit into
beardthelion wants to merge 1 commit into
Conversation
run_agent.py fired the "on_session_end" plugin hook at the end of every run_conversation() call (once per user message), not at actual session boundaries. This was misleading and caused google_meet's session-end cleanup to fire every turn. Added "on_turn_end" to the hook registry and changed the per-turn fire in run_agent.py to use it. Disk-cleanup plugin migrated to on_turn_end (its per-turn behavior was intentional). Google_meet stays on on_session_end (fires from CLI/gateway at real session boundaries).
beardthelion
force-pushed
the
fix/plugin-hook-rename
branch
from
May 15, 2026 18:40
e1f184a to
f6c4d79
Compare
Contributor
|
Thanks for identifying the naming mismatch. Current main still reproduces it: Problems
Suggested changes
Automated hermes-sweeper review. |
Contributor
Author
|
Closing. Main still uses on_session_end as the session-end extraction hook, so renaming it to on_turn_end no longer lines up with current behavior. |
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.
What does this PR do?
Renames the per-turn plugin hook from
on_session_endtoon_turn_endinrun_agent.py. The hook fired at the end of everyrun_conversation()call (once per user message), not at actual session boundaries — the name was misleading.Note: This conflicts with PR #22095 which adds
on_turn_start/on_turn_endas NEW hooks while keepingon_session_endfiring per-turn. This PR takes the cleaner approach: rename the existing per-turn fire instead of adding redundant hooks. PR #22095 should adapt to use theon_turn_endhook added here.Related Issue
Discovered during full repo audit (2026-05-14). No pre-existing issue.
Type of Change
Changes Made
hermes_cli/plugins.py: Addedon_turn_endtoVALID_HOOKShermes_cli/hooks.py: Addedon_turn_endtest fixturerun_agent.py: Changed per-turn hook fire fromon_session_endtoon_turn_endplugins/disk-cleanup/__init__.py: Migrated registration fromon_session_endtoon_turn_endtests/plugins/test_disk_cleanup_plugin.py: Updated assertion to checkon_turn_endNot changed:
google_meetplugin stays onon_session_end(fires at real session boundaries from CLI/gateway).How to Test
scripts/run_tests.sh tests/plugins/ tests/hermes_cli/test_hooks_cli.py -q— all passon_turn_endhookon_session_endhook