chat: Add source attribution to agent responses - #453
Open
Logan Ramos (lramos15) wants to merge 1 commit into
Open
Logan Ramos (lramos15) wants to merge 1 commit into
Logan Ramos (lramos15) wants to merge 1 commit into
Conversation
Keep supporting sources and text ranges in chat state so clients can display citations after streaming and recover them from snapshots and history. Add provider-neutral text and page locations, documentation, generated client types, and shared conformance tests.\n\nRefs #452.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Giuseppe Cianci (Giuspepe)
approved these changes
Sep 16, 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.
Problem
An agent may base an answer on web pages, files, or documents. AHP currently has no shared way to connect those sources to the parts of the answer they support. That information should remain available when another client joins, reconnects, or loads older turns.
Closes #452.
What changed
attributionresponse part. It points to an earlier Markdown or reasoning part and lists supporting sources and text ranges.chat/responsePartbefore ending the turn. No new command or action is needed.Compatibility and scope
Clients can ignore attribution and continue showing the original answer. The data stays in chat state for snapshots and history. It does not grant access to a source or claim that the answer has been independently verified.
The change is not tied to a particular agent, model, harness, or search tool. Search planning, live search progress, ranking, and citation/source-panel UI are not included. No protocol or package version was changed.
Validation
All passed:
npm run generatenpm test(459 tests; 100% reducer branch coverage)npm run docs:buildgo vetThe shared fixtures cover attribution after streaming, Unicode and multi-line ranges, overlapping spans, whole-answer attribution, history loading, cancellation, error/resume, snapshots, and unknown source-location kinds.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com