Keep fallback retrieval failures distinct from empty results - #850
Merged
WaylandYang merged 3 commits intoSep 21, 2026
Merged
Conversation
This was referenced Sep 21, 2026
Maya-Kid
force-pushed
the
fix/chat-fallback-retrieval-errors
branch
from
September 21, 2026 09:28
c2b79d0 to
03d5af4
Compare
This was referenced Sep 21, 2026
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Maya-Kid
force-pushed
the
fix/chat-fallback-retrieval-errors
branch
from
September 21, 2026 10:25
03d5af4 to
5071b88
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 head5071b883b7fcfcfe6a745e49dd788817a5ed42ac.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.
When a provider rejects tool calling,
legacy_ragcurrently converts any retrieval error into an empty result and requests an ordinary answer. A database failure can therefore look like missing evidence and end withdone.Handle retrieval errors explicitly: log the diagnostic server-side, send the existing safe
errorevent, and stop before requesting or saving a fallback answer. Successful empty retrieval and embedding-to-BM25 degradation keep their existing behavior.Linux validation against an isolated migrated PostgreSQL database, using real Chat handlers and a local HTTP model substitute:
done; the fix emits error, sends no plain-model request, and stores no assistant answer.UTOPIA_TEST_REQUIRE_DB=1. CI adds the guarded fallback regressions to the PostgreSQL job.No paid endpoint or business data was used. The change does not alter fallback eligibility, retrieval ranking, the empty-result prompt, persistence policy, or #845's finalization boundary. Client EOF semantics are a separate workstream; this PR guarantees the server emits an error without a success terminal.