Conversation
Author
|
Closing after independent lifecycle review found a release blocker: Hermes currently invokes |
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
on_session_finalizeplugin hook on currentmain/new, which reuses its agent and context engineWhy
Hermes deep-copies the registered context-engine prototype for each
AIAgent. In long-lived Desktop and gateway processes, retiring an agent does not guarantee that the clone's SQLite-backed LCM helpers are closed. Finalized sessions can therefore leave Store, DAG, and lifecycle descriptors open.The plugin already owns an exact weak session-to-engine registry and an idempotent
shutdown()boundary. This change connects those existing pieces through Hermes' supported hard session-boundary hook; it does not patch Hermes core or sweep unrelated engines.This refreshes #470 on current
main. It is complementary to #501: shared clone storage reduces per-clone SQLite ownership, while this hook closes the finalized clone's own lease/resources at the host lifecycle boundary.Validation
HERMES_HOME=<temp> pytest tests/test_plugin_lifecycle_cleanup.py tests/test_packaging_install.py -q-> 40 passedpytest tests/test_lcm_core.py tests/test_lcm_engine.py tests/test_packaging_install.py tests/test_plugin_lifecycle_cleanup.py -q-> 1100 passedpytest -qscripts/validate_release.sh --full --keep-going --output /tmp/hermes-lcm-release-validation-finalize-clones-v2git diff --check origin/main...HEAD && git diff --check && git diff --cached --checkNotes
state.dbconnections.Refs #463
Replaces #470