feat(openviking): sync full turn context (tool calls + results) to OpenViking session#34763
Open
pty819 wants to merge 1 commit into
Open
feat(openviking): sync full turn context (tool calls + results) to OpenViking session#34763pty819 wants to merge 1 commit into
pty819 wants to merge 1 commit into
Conversation
The OpenVikingMemoryProvider.sync_turn() previously only received user_content and assistant_content as plain text (truncated to 4K each), discarding all tool calls, tool results, and intermediate messages from multi-step agent turns. This commit wires the optional messages kwarg (added in commit 5a95fb2 / NousResearch#28065) to OpenViking's session sync path: - Accept messages: Optional[List[Dict]] in sync_turn() signature - Track _last_message_count to POST only the delta of new messages on each turn (avoids re-sending entire history every call) - Serialize tool_calls to compact text form for the session API - Include role:tool messages (tool results) alongside user/assistant - Skip system prompts (session-wide state, not conversational turns) - Reset _last_message_count in initialize() and on_session_switch() - Keep legacy text-only fallback when messages is not provided Closes NousResearch#34762
584a1cd to
8ac675a
Compare
19 tasks
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.
Closes #34762
Summary
The
OpenVikingMemoryProvider.sync_turn()previously only receiveduser_contentandassistant_contentas plain text (truncated to 4K each), discarding all tool calls, tool results, and intermediate messages from multi-step agent turns.This PR wires the optional
messageskwarg (added in commit5a95fb2e1/ #28065) to OpenViking's session sync path, so the full turn context is posted to the OpenViking session for memory extraction.Changes
All changes are in
plugins/memory/openviking/__init__.py:sync_turn(): Addedmessages: Optional[List[Dict]]parameter — triggersMemoryManagerto deliver the full message list_last_message_count— only POST new messages since last sync, avoiding re-sending the entire conversation history every turn[function_name(args)]for the OpenViking session APIrole: "tool"messages are included alongside user/assistant messageson_session_switch(): Added to reset_last_message_countwhen the session changes (/resume,/reset,/branch)messagesis not providedVerification
messagesparameter continue getting the old text-only signaturesync_turn()joins the previous thread before starting a new one