Repository navigation
fix(hooks): read the user_message Hermes passes to pre_llm_call - #12
Merged
Merged
Conversation
The hint hook looked for user_text, prompt, message, content and messages, but Hermes calls pre_llm_call with user_message and conversation_history. The hook found no text, returned None on every turn, and logged zero hints across all six public Discord profiles. Its tests passed because they used the message= alias. Add user_message first and a test that calls the hook with the exact keyword set Hermes v0.22.5 sends. Claude-Session: https://claude.ai/code/session_01B6XeATwx1VYhtEMDunQWD3
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.
Problem
inject_discord_read_hintreads the turn text fromuser_text,prompt,message,contentormessages. Hermes callspre_llm_callwithuser_messageandconversation_history, so the hook finds no text and returnsNoneon every turn. In production it has logged no hints on any of the public Discord profiles, while the same plugin's INFO lines do reach the log. The existing tests passed because they use themessage=alias.Change
user_messagefirst. The older aliases stay as fallbacks.test_injects_hint_from_the_kwargs_hermes_passescalls the hook with the exact keyword set from Hermes v0.22.5agent/turn_context.py_collect_pre_llm_call_context.Verification
tests/test_hooks.py: 5 tests pass. With the fix reverted, only the new test fails.test_hermes_contract.test_local_valid_hooks_match_runtimefails locally on unmodifiedorigin/maintoo. It compares against an older local Hermes checkout and is unrelated to this change. CI'stestjob is green on main.https://claude.ai/code/session_01B6XeATwx1VYhtEMDunQWD3