You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.NET: Sync AG-UI conversation history from backend #2510
We're creating a thin web client so we want to store message history in the backend, and send it to the client on initial connection. I don't see any support anywhere for MESSAGE_SNAPSHOT events so I attempted to implement it in agent middleware by creating and managing an AgentThread. The theory is I could just pass some flag from the frontend which would skip the normal agent run in the middleware and retrieve and emit the thread messages as a snapshot instead. This all worked well up till the point that I realised that there is no MessageSnapshotEvent and so AsAGUIEventStreamAsync can never emit a message snapshot, and all that stuff is internal so there appears to be no way to define or emit some other AGUI event at all.
Do you have a plan to add message snapshot support at some point, or are you ever going to provide a way to more directly emit the AG UI events?
Reacted by Imran Sh, jcageman, Ramhari Gyawali, viter-fg, MingHuiLiu and Artur Dorochowicz
Also, other little things like message timestamps... Ultimately I think it's fine if Agent Framework chooses not to support these (which it doesn't seem to currently) but it would be great if we had a way to add things like this ourselves if we deem them necessary. I think this falls into the same category of more direct control over the AG-UI events as described above.
I had the same problem, it will be great if at the end we could have a sample in Repo which demonstrate how to implement chat-history with AG-UI Frameworks like Copilotkit in C#.
Reacted by Arjen de Blok, Ramhari Gyawali, Matthew Bélair, wallee, javfonsecaj, viter-fg, Imran Sh, Andrei Danciu, Heena Ugale, Lukasz Grzegorzek and 5 more
The current AG-UI conversion pipeline forwards this event unchanged:
RUN_STARTED
MESSAGES_SNAPSHOT
RUN_FINISHED
We verified that message IDs, roles, authors, and ordering are preserved.
Hosting does not automatically infer which store represents an application's authoritative history. The application loads that history from its ChatHistoryProvider, session store, or database and emits the snapshot at the appropriate synchronization point.
Since MessagesSnapshotEvent and direct public event emission are now available, this issue can be closed as resolved.
Activity
javiercn commentedon Nov 28, 2025
Nathan Keir (@Kermittt) thanks for contacting us.
Yes, this is a current limitation as we work through how we want to best expose AG-UI concepts.
Kermittt commentedon Dec 2, 2025
Also, other little things like message timestamps... Ultimately I think it's fine if Agent Framework chooses not to support these (which it doesn't seem to currently) but it would be great if we had a way to add things like this ourselves if we deem them necessary. I think this falls into the same category of more direct control over the AG-UI events as described above.
imranshams commentedon Dec 2, 2025
Hey Javier Calvarro Nelson (@javiercn),
I had the same problem, it will be great if at the end we could have a sample in Repo which demonstrate how to implement chat-history with AG-UI Frameworks like Copilotkit in C#.
javiercn commentedon Aug 18, 2026
Backend-to-client message synchronization is now supported through the public
MessagesSnapshotEventinAGUI.Abstractions.A delegating agent can load its authoritative history and emit it directly:
The current AG-UI conversion pipeline forwards this event unchanged:
We verified that message IDs, roles, authors, and ordering are preserved.
Hosting does not automatically infer which store represents an application's authoritative history. The application loads that history from its
ChatHistoryProvider, session store, or database and emits the snapshot at the appropriate synchronization point.Since
MessagesSnapshotEventand direct public event emission are now available, this issue can be closed as resolved.