Publish citation sources added by document reads - #849
Merged
WaylandYang merged 4 commits intoSep 21, 2026
Merged
Conversation
Maya-Kid
force-pushed
the
fix/chat-document-citation-sources
branch
from
September 21, 2026 09:28
9dfe7fb to
9a9f2e0
Compare
This was referenced Sep 21, 2026
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Maya-Kid
force-pushed
the
fix/chat-document-citation-sources
branch
from
September 21, 2026 10:25
9a9f2e0 to
4d8204e
Compare
# Conflicts: # crates/utopia-server/src/api/chat_empty_reply_tests.rs
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.
Latest dev synchronization (2026-09-21)
Based on
dev@474b904dc3e8014d42404a3c067af9906036a953; current head4d8204e016d79f97de4c46b3f0b2f09749d73132.Revalidated the combined integration tree
6cd976351b4d7cc7389730fce530526f4d197992on isolated Linux PostgreSQL fixtures (all 675 tracked source files hash-matched):cargo test -p utopia-server api::chat::, listed and executed 47 tests. All 37 introduced tests were observed passing: Hand off exhausted tool runs to an evidence-only final answer #845 22, Keep older chat handles from unregistering newer generations #848 1, Publish citation sources added by document reads #849 2, Keep fallback retrieval failures distinct from empty results #850 4, Preserve exact chat outcomes across stream closure and reattachment #851 3, Do not report fallback chat completion when saving fails #852 3, and upstream Assert a chat turn ends in exactly one earned terminal #858 2. No test module was deleted during CI consolidation.The evidence-only handoff core remains frozen. Earlier validation below belongs to its stated historical heads. Automated browser checks do not replace the maintainer's requested visual review.
get_documentadds citation numbers to the same tool sink as search, but itsdocumentstep did not trigger asourcesevent. A newly cited chunk was saved in history while live and reattached answers could not resolve its reference.Publish the existing full sources frame whenever the append-only source list grows, independently of the UI step kind. Repeated document reads and graph-only tools do not publish duplicate lists. The sink lock is released before yielding.
Validation on Linux with an isolated migrated PostgreSQL database and a local gated HTTP model substitute:
ea0557b: search A → read A+B leaves only A in the live snapshot; direct document reads leave no sources.chat,reattach, and history handlers. Repeated reads keep IDs/numbers stable; live sources, a pre-answer reattachment snapshot and stored sources agree.No change to retrieval ranking, citation UI, truncation budgets, wire schema, or model finalization policy. No paid model or business data was used. Browser verification is not claimed by these handler tests.
Additional integration validation: isolated tree
f7bcd0878bf490d6efb122b71d6f13d379df4709combines this change with #845 and the other scoped Chat fixes. Linux Rust fmt, strict workspace Clippy, workspace build and 1,013 tests pass (one pre-existing external-HTTPS RSS test ignored); frontend 129 module tests, 27 real-component browser subtests and build pass. Database/PDF test guards were enabled. This combined result is separate from the standalone checks above.Chrome against the actual Linux backend and PostgreSQL also confirmed that live, reattached and reloaded citation [2] opens the ingested document preview; the pre-answer snapshot sources equal stored history. The tool-phase event-count assertion now stops before the final graph step, so it still rejects duplicate document publication while allowing #845's later persisted-source replay.