refactor: Refactor Frontend/Backend Conversation Flow for Simpler Message Processing#663
Merged
Conversation
…ChatService and TestChatService
… request_body parameter
Pavan-Microsoft
requested review from
Avijit-Microsoft,
Prajwal-Microsoft,
Roopan-Microsoft,
Vinay-Microsoft,
aniaroramsft,
brittneek,
nchandhi and
toherman-msft
as code owners
November 28, 2025 05:15
Avijit-Microsoft
approved these changes
Nov 28, 2025
Contributor
|
🎉 This PR is included in version 3.15.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request refactors the way chat messages and conversation requests are handled in the app, simplifying the data flow and removing legacy support for tracking the "last RAG response." The changes streamline how messages are passed between the frontend and backend, and clean up unused code and state properties.
Frontend state and message handling:
AppProvider.tsx,AppReducer.tsx,ActionConstants.tsx, and the chat component, including the associated reducer actions and state properties. ([[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-4d5ea799575b73ec4c5039fcd11d8b55d55c6e43dfb993e54a677ecc35661d72L25),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-8918bba936dfa6b9bbe5de0c46e96c396f2d25789f53fe67677f7fa8bb3749f3L31),[[3]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-8918bba936dfa6b9bbe5de0c46e96c396f2d25789f53fe67677f7fa8bb3749f3L74),[[4]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-8918bba936dfa6b9bbe5de0c46e96c396f2d25789f53fe67677f7fa8bb3749f3L190-L193),[[5]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a1136a23abe9a62b9696e982ba879fa87243fd36db98a7d7c868b3b413fa32aeL91-R91),[[6]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a1136a23abe9a62b9696e982ba879fa87243fd36db98a7d7c868b3b413fa32aeL202-L209))updatedMessagesare constructed in the chat component (Chat.tsx) to avoid merging with previous state and instead use only the latest relevant messages for each update. ([[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL76-R83),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL99-R99),[[3]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL274-R271),[[4]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL297-R294),[[5]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL316-R309),[[6]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL360-R351),[[7]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL553-R532),[[8]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL596-R575),[[9]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL615-R590),[[10]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL649-R620),[[11]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL664-R631),[[12]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL682-R643))[[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL221-R221),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-a8495413a74092724ad57e37fffa0de07c14fc3a4c605214fe3dcb5ea062f67fL432-R417),[[3]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-600167695c2ed37d44d2c2e18d186e815d6bed998079e2eb934a305fa9ee1b6eL42-R42))API and backend request structure:
queryfield instead of an array of messages and last RAG response, and updated the backend route to consume this new format. ([[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-5e156b02a6e78df5b2df1b438d2051f134fa18e4a259052ad0bb66acbff5673fL290-R291),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-9f272a148c254bda26deb3ec575a6fe54454afc6a327b86ebc3ae2a8a628cf55L120-R122))historyGenerateAPI function and cleaned up related types and metadata fields that are no longer needed. ([[1]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-5e156b02a6e78df5b2df1b438d2051f134fa18e4a259052ad0bb66acbff5673fL435-L470),[[2]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-600167695c2ed37d44d2c2e18d186e815d6bed998079e2eb934a305fa9ee1b6eL149-L152),[[3]](https://github.com/microsoft/Conversation-Knowledge-Mining-Solution-Accelerator/pull/663/files#diff-600167695c2ed37d44d2c2e18d186e815d6bed998079e2eb934a305fa9ee1b6eL161-L164))These changes make the codebase easier to maintain and ensure a more consistent flow of data between the frontend and backend.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the chat and update api payload sending only required info.