-
Notifications
You must be signed in to change notification settings - Fork 748
feat(amazonq): Use Chat History DB instead of in-memory store #6985
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
feat(amazonq): Use Chat History DB instead of in-memory store #6985
Conversation
|
87284a8 to
9bc7ee8
Compare
|
/retrybuilds |
9bc7ee8 to
96f76c3
Compare
packages/core/src/codewhispererChat/controllers/chat/controller.ts
Outdated
Show resolved
Hide resolved
de4747d to
b4f8fef
Compare
b4f8fef to
0398a10
Compare
feece49 to
c6c760e
Compare
c6c760e to
e58911b
Compare
| } else { | ||
| allMessages.splice(-2) | ||
| this.logger.info(`Removed last assistant message and user message`) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the case where the end of the chat history is a user message, shouldn't the assistant always respond?
| } | ||
|
|
||
| // Removes the most recent message(s) from the chat history for a given tab | ||
| clearRecentHistory(tabId: string): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"recent" is ambiguous. Based on implementation it looks like it removes the last "exchange" (pair of messages). Anyway to make this more clear in docstring + name of the function?
| * 4. If the last message is from the assistant and it contains tool uses, and a next user | ||
| * message is set without tool results, then the user message will have cancelled tool results. | ||
| */ | ||
| fixHistory(tabId: string, newUserMessage: ChatMessage): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is definitely some non-trivial logic in this class that would benefit from some testing.
Hweinstock
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving and merging to unblock, while @tsmithsz is OOTO. Hope there is time to add a solid test suite for this logic in a follow-up.
Problem
We need to switch to using the Chat History DB instead of the local store
Solution
Tested manually
feature/xbranches will not be squash-merged at release time.