Fix: Compaction client <-> server sync (#5481)

This commit is contained in:
David Katz
2025-10-30 14:14:10 -04:00
committed by GitHub
parent 9435737cde
commit 1714990d42
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -146,6 +146,8 @@ async function streamFromResponse(
}
case 'UpdateConversation': {
log.messages('conversation-update', event.conversation.length);
// WARNING: Since Message handler uses this local variable, we need to update it here to avoid the client clobbering it.
// Longterm fix is to only send the agent the new messages, not the entire conversation.
currentMessages = event.conversation;
updateMessages(event.conversation);
break;
+3
View File
@@ -354,6 +354,9 @@ export function useMessageStream({
}
case 'UpdateConversation': {
// WARNING: Since Message handler uses this local variable, we need to update it here to avoid the client clobbering it.
// Longterm fix is to only send the agent the new messages, not the entire conversation.
currentMessages = parsedEvent.conversation;
setMessages(parsedEvent.conversation);
break;
}