-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Obs AI Assistant] error when opening old conversation #176299
Comments
Pinging @elastic/obs-knowledge-team (Team:obs-knowledge) |
@viduni94 fwiw, this is a warning that is logged in the console, and it happens because the conversationId changes during the lifecycle of the component, which we don't support because of the complexity of creating a new conversation and then updating the url/conversation id. If you manage to reproduce, I would try to figure out if there is actually a bug, and if not, maybe there's a way that we can prevent the warning. |
Hi @dgieselaar I tried fixing the error by not passing const { conversation, messages, next, state, stop, saveTitle } = useConversation({
initialConversationId,
...(!initialConversationId ? { initialMessages } : {}),
initialTitle,
chatService,
connectorId: connectors.selectedConnector,
onConversationUpdate,
}); However, I realized that as long as Let me know if you have any thoughts on this. Thank you Video of reproducing the error: |
@viduni94 This code is quite a mess, sorry about that 😄 I think what you should be able to do is to use the conversationService to create a new conversation. That will rotate the key used for the Line 128 in ee341d5
|
Hi @dgieselaar I did try this solution yesterday, however when I open a new conversation using above method, the flyout closes and reopens instead of remaining open and showing a blank conversation. Hence why I was looking for a way to clear the initial messages instead. I'll check whether I can use Update: |
…d from contextual insights (elastic#176299)
…d from contextual insights (elastic#176299)
…d from contextual insights (elastic#176299)
…d from contextual insights (elastic#176299)
…d from contextual insights (elastic#176299)
…d from contextual insights (elastic#176299)
…c#197745) Closes elastic#176299 ## Summary ### Problem When a chat is started from contextual insights, `initialMessages` are being populated from the temp conversation created from the error. Because the `initialMessages` are present, when an old conversation is clicked, the conversation ID of that conversation and the `initalMessages` from the temp chat are passed to the conversation. This throws an error, as there is a condition which restricts both of these being passed to `useConversation` which is used by the `ChatBody`. - Only one of these should be passed (not both) ### Solution With the current implementation, even though not passing `initialMessages` allows the user to open previous conversations successfully, it doesn't allow the user to start a new chat because as long as initial messages are set, they will be loaded when the New Chat button is clicked instead of showing a blank conversation. Clearing initial messages requires re-architecting how the Chat uses the conversation. Therefore, as the solution, when a chat is opened from contextual insights, the ConversationList will be hidden. The user can interact with the AI Assistant on the opened chat with initial messages from contextual insights. (cherry picked from commit 287c1ec)
…c#197745) Closes elastic#176299 ## Summary ### Problem When a chat is started from contextual insights, `initialMessages` are being populated from the temp conversation created from the error. Because the `initialMessages` are present, when an old conversation is clicked, the conversation ID of that conversation and the `initalMessages` from the temp chat are passed to the conversation. This throws an error, as there is a condition which restricts both of these being passed to `useConversation` which is used by the `ChatBody`. - Only one of these should be passed (not both) ### Solution With the current implementation, even though not passing `initialMessages` allows the user to open previous conversations successfully, it doesn't allow the user to start a new chat because as long as initial messages are set, they will be loaded when the New Chat button is clicked instead of showing a blank conversation. Clearing initial messages requires re-architecting how the Chat uses the conversation. Therefore, as the solution, when a chat is opened from contextual insights, the ConversationList will be hidden. The user can interact with the AI Assistant on the opened chat with initial messages from contextual insights.
Summary
An error is thrown when picking an old conversation from the chat panel. I was only able to trigger this (on
main
) when opening the chat from a contextual insightSteps to reproduce:
error_old_conversation.mov
The text was updated successfully, but these errors were encountered: