-
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] Fix error when opening an old conversation #197745
[Obs AI Assistant] Fix error when opening an old conversation #197745
Conversation
6c47645
to
c6750a5
Compare
472203c
to
40ce4ee
Compare
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
40ce4ee
to
48e5e4c
Compare
Hi @sorenlouv Thanks a lot. |
...gins/observability_solution/observability_ai_assistant/public/components/insight/insight.tsx
Outdated
Show resolved
Hide resolved
0da77dd
to
98e0e2f
Compare
98e0e2f
to
e343c9f
Compare
…from contextual insights
…d from contextual insights (elastic#176299)
e343c9f
to
9190939
Compare
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
cc @viduni94 |
Starting backport for target branches: 8.x |
…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)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…197745) (#198611) # Backport This will backport the following commits from `main` to `8.x`: - [[Obs AI Assistant] Fix error when opening an old conversation (#197745)](#197745) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Viduni Wickramarachchi","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-31T19:16:52Z","message":"[Obs AI Assistant] Fix error when opening an old conversation (#197745)\n\nCloses https://github.com/elastic/kibana/issues/176299\r\n\r\n## Summary\r\n\r\n### Problem\r\n\r\nWhen a chat is started from contextual insights, `initialMessages` are\r\nbeing populated from the temp conversation created from the error.\r\nBecause the `initialMessages` are present, when an old conversation is\r\nclicked, the conversation ID of that conversation and the\r\n`initalMessages` from the temp chat are passed to the conversation. This\r\nthrows an error, as there is a condition which restricts both of these\r\nbeing passed to `useConversation` which is used by the `ChatBody`.\r\n- Only one of these should be passed (not both)\r\n\r\n### Solution\r\nWith the current implementation, even though not passing\r\n`initialMessages` allows the user to open previous conversations\r\nsuccessfully, it doesn't allow the user to start a new chat because as\r\nlong as initial messages are set, they will be loaded when the New Chat\r\nbutton is clicked instead of showing a blank conversation. Clearing\r\ninitial messages requires re-architecting how the Chat uses the\r\nconversation.\r\n\r\nTherefore, as the solution, when a chat is opened from contextual\r\ninsights, the ConversationList will be hidden. The user can interact\r\nwith the AI Assistant on the opened chat with initial messages from\r\ncontextual insights.","sha":"287c1ec62e8ae64e58ea3abf561ab626e7530d43","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:Obs AI Assistant","ci:project-deploy-observability","backport:version","v8.17.0"],"title":"[Obs AI Assistant] Fix error when opening an old conversation","number":197745,"url":"https://github.com/elastic/kibana/pull/197745","mergeCommit":{"message":"[Obs AI Assistant] Fix error when opening an old conversation (#197745)\n\nCloses https://github.com/elastic/kibana/issues/176299\r\n\r\n## Summary\r\n\r\n### Problem\r\n\r\nWhen a chat is started from contextual insights, `initialMessages` are\r\nbeing populated from the temp conversation created from the error.\r\nBecause the `initialMessages` are present, when an old conversation is\r\nclicked, the conversation ID of that conversation and the\r\n`initalMessages` from the temp chat are passed to the conversation. This\r\nthrows an error, as there is a condition which restricts both of these\r\nbeing passed to `useConversation` which is used by the `ChatBody`.\r\n- Only one of these should be passed (not both)\r\n\r\n### Solution\r\nWith the current implementation, even though not passing\r\n`initialMessages` allows the user to open previous conversations\r\nsuccessfully, it doesn't allow the user to start a new chat because as\r\nlong as initial messages are set, they will be loaded when the New Chat\r\nbutton is clicked instead of showing a blank conversation. Clearing\r\ninitial messages requires re-architecting how the Chat uses the\r\nconversation.\r\n\r\nTherefore, as the solution, when a chat is opened from contextual\r\ninsights, the ConversationList will be hidden. The user can interact\r\nwith the AI Assistant on the opened chat with initial messages from\r\ncontextual insights.","sha":"287c1ec62e8ae64e58ea3abf561ab626e7530d43"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197745","number":197745,"mergeCommit":{"message":"[Obs AI Assistant] Fix error when opening an old conversation (#197745)\n\nCloses https://github.com/elastic/kibana/issues/176299\r\n\r\n## Summary\r\n\r\n### Problem\r\n\r\nWhen a chat is started from contextual insights, `initialMessages` are\r\nbeing populated from the temp conversation created from the error.\r\nBecause the `initialMessages` are present, when an old conversation is\r\nclicked, the conversation ID of that conversation and the\r\n`initalMessages` from the temp chat are passed to the conversation. This\r\nthrows an error, as there is a condition which restricts both of these\r\nbeing passed to `useConversation` which is used by the `ChatBody`.\r\n- Only one of these should be passed (not both)\r\n\r\n### Solution\r\nWith the current implementation, even though not passing\r\n`initialMessages` allows the user to open previous conversations\r\nsuccessfully, it doesn't allow the user to start a new chat because as\r\nlong as initial messages are set, they will be loaded when the New Chat\r\nbutton is clicked instead of showing a blank conversation. Clearing\r\ninitial messages requires re-architecting how the Chat uses the\r\nconversation.\r\n\r\nTherefore, as the solution, when a chat is opened from contextual\r\ninsights, the ConversationList will be hidden. The user can interact\r\nwith the AI Assistant on the opened chat with initial messages from\r\ncontextual insights.","sha":"287c1ec62e8ae64e58ea3abf561ab626e7530d43"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Viduni Wickramarachchi <[email protected]>
…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.
Closes #176299
Summary
Problem
When a chat is started from contextual insights,
initialMessages
are being populated from the temp conversation created from the error. Because theinitialMessages
are present, when an old conversation is clicked, the conversation ID of that conversation and theinitalMessages
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 touseConversation
which is used by theChatBody
.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.