fix(hermes): wrong JSON keys in sync_turn cause empty auto-compressed observations#384
fix(hermes): wrong JSON keys in sync_turn cause empty auto-compressed observations#384grodingo wants to merge 1 commit into
Conversation
The Hermes plugin's sync_turn() method sends conversation observations to the agentmemory /observe endpoint using keys 'input' and 'output', but the server's mem::observe handler extracts data using 'tool_input' and 'tool_output' (see src/functions/observe.ts). This key mismatch means raw.toolInput and raw.toolOutput are always undefined. When auto-compress is enabled, the LLM receives a nearly empty compression prompt (only timestamp + hookType + toolName), which produces generic, useless observations like: title: "Agent initiated conversation" narrative: "No specific content was provided" importance: 1 With the corrected keys, DeepSeek/Vision models receive the actual conversation content and produce meaningful, structured observations: title: "Verified fix for agentmemory plugin key naming" importance: 6 concepts: ["agentmemory plugin", "tool_input/tool_output key renaming"] facts: ["The fix replaces 'input'/'output' keys with..."]
|
@grodingo is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesObserve endpoint field names
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The Hermes plugin's
sync_turn()sends conversation observations to the/agentmemory/observeendpoint with keys"input"and"output":However, the server's
mem::observehandler (insrc/functions/observe.ts) extracts observation data using"tool_input"and"tool_output":This is consistent with how the Claude Code hooks (
dist/hooks/post-tool-use.mjs) send data:Impact
Since
raw.toolInputandraw.toolOutputare alwaysundefined, the compression prompt built bybuildCompressionPrompt()(insrc/prompts/compression.ts) contains only the timestamp, hookType, andtoolName="conversation". The LLM receives no actual content and produces generic, useless observations:Every conversation turn produces identical garbage, polluting the memory store and making injected context useless (the
mem::contextfunction serves these empty observations back into the agent's prompt).Fix
Rename the keys to match what the server expects:
Verification
Tested locally with agentmemory v0.9.12 + DeepSeek
deepseek-v4-flashas the compression LLM. After the fix, the same observation payload produces:Summary by CodeRabbit