hermes - 💡(How to fix) Fix feat(openviking): sync full turn context (tool calls + results) to OpenViking session [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

OpenVikingMemoryProvider.sync_turn() at plugins/memory/openviking/__init__.py:568 has the legacy signature:

def sync_turn(self, user_content, assistant_content, *, session_id=""):

Because it doesn't declare a messages parameter, MemoryManager._provider_sync_accepts_messages() returns False, and the rich message context is never delivered.

Fix Action

Fixed

Code Example

def sync_turn(self, user_content, assistant_content, *, session_id=""):
RAW_BUFFERClick to expand / collapse

Problem

The OpenVikingMemoryProvider.sync_turn() currently only receives user_content and assistant_content as plain text (truncated to 4000 chars each). This means all tool calls, tool results, and intermediate reasoning from multi-step agent turns are lost in OpenViking's session history.

The infrastructure to pass full conversation context was added in #28065 / commit 5a95fb2e1MemoryProvider.sync_turn() now accepts an optional messages kwarg containing the complete OpenAI-style message list for the completed turn (including tool_calls, tool role messages, etc.). However, no in-tree memory provider currently uses it.

Root Cause

OpenVikingMemoryProvider.sync_turn() at plugins/memory/openviking/__init__.py:568 has the legacy signature:

def sync_turn(self, user_content, assistant_content, *, session_id=""):

Because it doesn't declare a messages parameter, MemoryManager._provider_sync_accepts_messages() returns False, and the rich message context is never delivered.

Impact

  • Tool invocations (function names, arguments) are missing from OpenViking sessions
  • Tool results are not stored — the knowledge extracted via tools is invisible to OpenViking's memory extraction pipeline
  • Only the final assistant text (already truncated to 4K) is persisted, significantly reducing the value of auto-extracted memories from session commits

Proposed Fix

The fix lives entirely in plugins/memory/openviking/__init__.py:

  1. Accept messages: Optional[List[Dict]] in sync_turn() signature — this triggers MemoryManager to deliver the full message list
  2. Track _last_message_count so we only POST the delta of new messages on each turn (avoiding re-sending the entire history every call)
  3. Serialize tool_calls to a compact text form [function_name(args)] for posting to the OpenViking session API
  4. Include role: "tool" messages (tool results) alongside user/assistant messages
  5. Skip system prompts (session-wide state, not conversational turns)
  6. Reset _last_message_count on session switch (on_session_switch) and initialization
  7. Keep legacy fallback when messages is not provided (backward-compatible)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix feat(openviking): sync full turn context (tool calls + results) to OpenViking session [1 pull requests]