skip Memory entries in conversation replay on restore

Memory entries (surfaced nodes, memory_render results) are part of
the context window but not the conversation display. Skip them
during replay_session_to_ui to avoid showing system-reminder
content as user messages.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-02 16:28:57 -04:00
parent 8238afd922
commit ef7dd59b7e

View file

@ -1063,6 +1063,8 @@ fn replay_session_to_ui(entries: &[types::ConversationEntry], ui_tx: &ui_channel
let mut target = StreamTarget::Conversation; let mut target = StreamTarget::Conversation;
for entry in entries { for entry in entries {
// Memory entries are in the context window but not the conversation display
if entry.is_memory() { continue; }
let msg = entry.message(); let msg = entry.message();
match msg.role { match msg.role {
types::Role::System => {} types::Role::System => {}