Repository navigation
Distinguish retrieved sources from cited references - #1268
Merged
Paul Lizer (paullizer) merged 2 commits intoAug 18, 2026
Merged
Conversation
Separate the complete set of retrieved workspace and web search results from the smaller set of references the final assistant response actually cites, so Used documents, conversation details, and export references stop presenting every retrieval candidate as a citation. New assistant responses persist exact cited document and web subsets alongside the unchanged full source arrays. Conversation reads use a compact persisted aggregate instead of reparsing message history, and conversations without tracking keep their existing document list as a no-migration compatibility fallback. - Add shared citation tracking with exact citation IDs plus strict filename/location matching for visible legacy-style source references - Persist cited subsets across non-streaming, streaming, mixed-source, assigned-knowledge, document-action, partial, and workflow responses - Rebuild exact used documents after retry, edit, attempt switching, deletion, and conversation fork, and repair a failed rebuild on read - Propagate tracking through collaboration conversion, synchronization, serialization, and stream mirroring, including persisted partials - Show all source documents in conversation details with a Cited badge, and drive Used documents from exact usage plus legacy fallback - Use cited document/web subsets plus executed tools for conversation Markdown/PDF and per-message Word, PowerPoint, and email references while JSON exports retain full source arrays for audit - Render sheet, page, and workbook schema locations consistently Fixes #1249 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
9 tasks
CodeQL flagged three polynomial regular expressions in the new citation tracking module. The inline citation group, visible source reference, and page range patterns all combined unbounded whitespace or lazy quantifiers with variable-length character classes, so hostile or malformed model output could force quadratic backtracking while parsing references. Replace the unbounded quantifiers with bounded repetition, precompile the page range pattern, and add a regression test that asserts adversarial inputs are parsed well within a fixed time budget. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Summary
Separates the complete set of retrieved workspace and web search results from the smaller set of references the final assistant response actually cites, so Used documents, conversation details, and export references stop presenting every retrieval candidate as a citation.
Sources stays the full retrieval/execution disclosure. New assistant responses additionally persist exact cited document and web subsets, so conversation reads and exports consume persisted data instead of reparsing message history.
Fixes #1249
Behavior
Persisted contract
Assistant messages keep
hybrid_citations,web_search_citations, andagent_citationsunchanged, and addcitation_tracking_version,cited_hybrid_citations, andcited_web_search_citations. Conversations gainused_documentsfor exact active-response usage andlegacy_used_documentsfor pre-tracking compatibility.Matching uses exact
[#citation-id]tokens, with strict filename/location matching as a fallback for the visible(Source: file, Page/Sheet/Location: value)format. Agent/tool records remain references because they represent executions that actually occurred; Foundry web-source proxies are deduplicated into web references.Coverage
Compatibility
No database migration and no read-time history parsing. Conversations and messages without tracking keep their existing document list and prior export behavior, and are never falsely marked as exactly cited.
Validation
test_chat_cited_source_tracking.py15/15 (matching, aggregation, lifecycle, collaboration, UI/export contracts)test_per_message_export.py16/16,test_per_message_powerpoint_export.py7/7test_conversation_fork.py,test_chat_retry_edit_streaming_parity.py4/4node --checkon all changed JS, whitespace/diff checksAuthenticated Playwright tests were updated (drawer selection, details Cited badge, citation parsing) but skip in CI-less environments without a UI base URL and storage state.
Version bumped to
0.250.215with release notes, fix documentation, and feature documentation updated.