Fix: Compaction client <-> server sync (#5481)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user