feat: add native Hermes Agent support - #1010
Open
ildunari wants to merge 1 commit into
Open
Conversation
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 first-class Hermes Agent support using context-mode's existing MCP server and session pipeline rather than introducing a parallel storage implementation.
This adds:
plugin.yaml+__init__.py) installable withhermes plugins install mksglu/context-mode --enablecontext-mode hook hermes <event>pre_llm_call(compaction_applied=...)signalmcp__context_mode__ctx_indextool, with unique per-tool-call sources and replacement only after confirmed success/ctx-stats,/ctx-doctor, and/ctx-searchHermes commands backed by the same MCP serverThis is intended as a more complete native-integration path alongside the work discussed in #981: the MCP server remains the data plane, while the Hermes plugin is only the lifecycle/control-plane bridge.
Architecture
The integration does not register a Hermes memory provider or context engine. It uses public plugin hooks and
PluginContext.dispatch_toolonly.Safety and failure behavior
pre_tool_call, so context-mode modify decisions become enforceable blocks with routing guidance rather than silently running the original command.tool_call_id(UUID fallback), preventing later calls from overwriting earlier indexed results.$HERMES_HOME/context-mode(normally~/.hermes/context-mode) so named/profile-scoped Hermes instances do not bleed state.Install
Verification
npm run typechecknpm run buildnpm testgit diff --checkPluginManagerdiscovery/load with isolatedHERMES_HOMEpre_llm_callhook bridge created a profile-scoped SessionDB and injected the Hermes routing blockcontext-modectx_index,ctx_search,ctx_stats, andctx_doctorpresentctx_indexsucceededctx_searchretrieved the indexed marker