feat: expose completed-turn message context to memory providers (salvage #28065)#34097
Merged
kshitijk4poor merged 2 commits intoMay 28, 2026
Merged
Conversation
1290110 to
a7daf73
Compare
Adds an optional `messages` keyword to the `MemoryProvider.sync_turn` contract so external/community memory plugins can receive the OpenAI-style conversation message list for the completed turn — including assistant tool calls and tool result content — not just the final assistant text. Dispatch uses signature inspection (`_provider_sync_accepts_messages`): only providers that declare a `messages` parameter (or `**kwargs`) receive it; all existing in-tree providers keep their legacy text-only signature and are called unchanged. No structured-trace envelope is added to core — providers reconstruct whatever they need from the standard message list. Also documents Memori as a standalone community memory provider. Salvaged from NousResearch#28065 — rebased onto current main. Co-authored-by: Dave Heritage <david@memorilabs.ai>
Maps both commit emails (david@memorilabs.ai, dave@devwdave.com) used on NousResearch#28065 to the devwdave GitHub account so the contributor audit in scripts/release.py passes.
a7daf73 to
d464d08
Compare
1 task
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…ri-trace-messages feat: expose completed-turn message context to memory providers (salvage NousResearch#28065)
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.
Salvages #28065 onto current
main.What this does
Adds an optional
messageskeyword to theMemoryProvider.sync_turncontract so external/community memory plugins can receive the OpenAI-style conversation message list for the completed turn — including assistant tool calls and tool result content — not just the final assistant text.This is the slimmed-down outcome agreed in the #28065 discussion: no structured-trace envelope in core. Providers reconstruct whatever they need (tool calls, results) from the standard message list. The earlier
version/capture_policy/per-tool-duration schema and the_record_turn_tool_trace/_turn_tool_tracemachinery are gone.Why salvage
The original branch was 17 commits behind
main, and its diff reverse-applied an intervening context-probe-tier fix (agent/conversation_loop.py). This branch re-applies only the intended feature changes on top of freshmain—conversation_loop.pygets exactly one line (messages=messages,), nothing else.Backward compatibility
Dispatch uses signature inspection (
_provider_sync_accepts_messages): only providers that declare amessagesparameter (or**kwargs) receive it. All 8 in-tree providers (honcho, mem0, supermemory, hindsight, retaindb, openviking, holographic, byterover) keep their legacy text-onlysync_turnsignature and are called unchanged — verified against their real signatures.Verification
tests/agent/test_memory_provider.py,tests/run_agent/test_memory_sync_interrupted.py), including new coverage for opted-in vs legacy dispatch.ruff checkclean on all touched core files; all compile.scripts/release.pyAUTHOR_MAP updated so the contributor audit passes (both of the original author's commit emails mapped).Original author preserved via authorship +
Co-authored-by. Closes #28065.