Skip to content

fix(hooks): read the user_message Hermes passes to pre_llm_call - #12

Merged
offendingcommit merged 1 commit into
mainfrom
fix/hint-hook-user-message
Oct 30, 2026
Merged

offendingcommit merged 1 commit into
mainfrom
fix/hint-hook-user-message

Conversation

@offendingcommit

Copy link
Copy Markdown
Owner

Problem

inject_discord_read_hint reads the turn text from user_text, prompt, message, content or messages. Hermes calls pre_llm_call with user_message and conversation_history, so the hook finds no text and returns None on 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 the message= alias.

Change

  • Read user_message first. The older aliases stay as fallbacks.
  • New test test_injects_hint_from_the_kwargs_hermes_passes calls the hook with the exact keyword set from Hermes v0.22.5 agent/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_runtime fails locally on unmodified origin/main too. It compares against an older local Hermes checkout and is unrelated to this change. CI's test job is green on main.

https://claude.ai/code/session_01B6XeATwx1VYhtEMDunQWD3

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
@offendingcommit
offendingcommit merged commit 3469992 into main Oct 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant