fix: clean up stale gateway pid files and skip wrapper memory plugins#13872
Closed
aditzel wants to merge 2 commits into
Closed
fix: clean up stale gateway pid files and skip wrapper memory plugins#13872aditzel wants to merge 2 commits into
aditzel wants to merge 2 commits into
Conversation
Collaborator
This was referenced Apr 22, 2026
Contributor
|
Thanks for the detailed PR, @aditzel! Both fixes here have since landed on Automated hermes-sweeper review.
Both fixes live at |
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
gateway.pidrecords directly whenget_running_pid()determines the recorded process is goneexclusivewhen their implementation advertisesregister_memory_provider/MemoryProviderWhy
Two separate foot-guns were showing up locally:
gateway.pidcould survive cleanup becauseremove_pid_file()only deletes the file when the current process owns it. That left launchd stuck in a restart loop, repeatedly loggingPID file race lost to another gateway instance.$HERMES_HOME/plugins/were still visible to the general plugin loader. Wrapper-style plugins (repo-root__init__.py, real implementation undersrc/) then tried to callctx.register_memory_provider(...)against the genericPluginContext, producing warnings like:Failed to load plugin 'muninndb': 'PluginContext' object has no attribute 'register_memory_provider'Test Plan
pytest tests/gateway/test_status.py::TestGatewayPidState::test_get_running_pid_removes_stale_json_pid_file -qpytest tests/hermes_cli/test_plugins.py::TestPluginDiscovery::test_user_memory_provider_plugins_are_classified_exclusive -qpytest tests/hermes_cli/test_plugins.py tests/gateway/test_status.py -qNotes
python -m pytest tests/ -q --ignore=tests/integration --ignore=tests/e2e --tb=short -n auto) and reproduced a large set of unrelated baseline failures;origin/mainis currently red ontests.ymlas well.