Skip to content

fix: improve chat rendering if there are additional chat messages #1039

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

kmile
Copy link
Contributor

@kmile kmile commented Apr 22, 2025

Problem

Solution

Remove a lot of unnecessary progress updates.

Reduces flickering in tool cards.

Enables streaming animation when rendering assistant responses.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kmile kmile force-pushed the improve-additional-chat-messages branch 2 times, most recently from 4f2b8e3 to e7aed5b Compare April 22, 2025 12:23
@kmile kmile marked this pull request as ready for review April 22, 2025 12:23
@kmile kmile requested a review from a team as a code owner April 22, 2025 12:23
@kmile kmile force-pushed the improve-additional-chat-messages branch 2 times, most recently from fd248a4 to 21c17a1 Compare April 22, 2025 12:30

mynahUi.updateLastChatAnswer(tabId, {
type: ChatItemType.ANSWER,
mynahUi.endMessageStream(tabId, chatResult.messageId ?? '', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this have the potential to break history if we aren't finishing with an answer card?

Copy link
Contributor Author

@kmile kmile Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't have to be the last card, just the one specified.

And in the backend, we only put the current assistantResponse items in the chatResult, the tools and previous responses go in the additionalMessages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

History is done on the server and yes, it currently breaks if we have lingering toolUses until we port over https://github.com/aws/aws-toolkit-vscode/blob/feature/agentic-chat/packages/core/src/shared/db/chatDb/chatDb.ts#L311

@kmile kmile force-pushed the improve-additional-chat-messages branch 2 times, most recently from cea8bf1 to 6fad504 Compare April 22, 2025 13:10
@kmile kmile enabled auto-merge (squash) April 22, 2025 13:14
@kmile kmile force-pushed the improve-additional-chat-messages branch 2 times, most recently from a8955ee to 3420883 Compare April 22, 2025 13:42
@kmile kmile force-pushed the improve-additional-chat-messages branch from 3420883 to fe12ed9 Compare April 22, 2025 13:55
@kmile kmile force-pushed the improve-additional-chat-messages branch from fe12ed9 to 59098f0 Compare April 22, 2025 14:05
@kmile kmile merged commit 70a086a into aws:main Apr 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants