chat: reconcile history by canonical message identity
This commit is contained in:
@@ -55,15 +55,19 @@ func handleChatPrompt(ctx context.Context, request protocol.Message, broker chat
|
||||
// sender's own client appended it locally, so it is excluded below.
|
||||
userFrame := protocol.ChatEventFrame{
|
||||
SessionID: sessionID,
|
||||
MessageID: hub.nextUserMessageID(),
|
||||
MessageID: prompt.NativeMessageID,
|
||||
Kind: protocol.ChatEventUser,
|
||||
Part: &protocol.ChatPart{Type: protocol.ChatPartText, ID: "usr", Text: prompt.Text},
|
||||
Client: sub.label,
|
||||
OperationID: prompt.OperationID,
|
||||
}
|
||||
if userFrame.MessageID == "" {
|
||||
userFrame.MessageID = hub.nextUserMessageID()
|
||||
}
|
||||
queued, refused := hub.submitPrompt(sessionID, &chatQueuedPrompt{
|
||||
text: prompt.Text,
|
||||
operationID: prompt.OperationID,
|
||||
nativeID: userFrame.MessageID,
|
||||
requestID: request.ID,
|
||||
write: write,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user