Repository navigation
fix: dev to main - improve citation handling, chat message ordering and enhances chat sessions switching - #1074
Merged
Merged
Conversation
…uestions on navigation
…t and citation collection
…ntain saved sequence
… sessions and improve message display logic
…e to prevent outdated loads from overwriting current chat state
…thers in response text
…e latest messages and prevent overwriting during navigation
fix: improve citation handling, chat message ordering and enhances chat sessions switching
Prajwal-Microsoft
approved these changes
Oct 28, 2026
Roopan-Microsoft
approved these changes
Oct 28, 2026
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 introduces significant improvements to citation handling in RAG responses, ensures chat message ordering is consistent and robust, and enhances the user experience when switching between chat sessions in the Explore page. The most important changes are summarized below.
Backend: Citation Handling and Message Ordering
_collect_citationsfunction with a new_number_citationsimplementation inservice.py, which accurately replaces raw citation markers in responses with sequential[N]markers and generates a deduplicated, ordered citation list. This ensures that citations are correctly linked to documents, even when markers are missing or duplicated. [1] [2] [3]chat_store.py) and Cosmos DB (cosmos_service.py) backends by sorting messages using a stable, explicit order field (sort_orderororder), falling back to timestamp as needed. This prevents message order issues when timestamps are tied or not unique. [1] [2]Frontend: Explore Page Session and UI Improvements
Explore.tsxto support multiple pending sessions, ensuring that typing indicators and answers are only shown for the currently active chat. This prevents UI glitches when switching sessions quickly. [1] [2] [3] [4]qandsource) are cleared after an auto-query is processed, preventing repeated questions on refresh or navigation.These changes collectively make citation display more reliable, chat history ordering more robust, and the chat UI more responsive and accurate when handling multiple sessions.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation