Do not report fallback chat completion when saving fails - #852
Conversation
|
Coordination note covering this PR and its siblings — #845, #848, #849, #850, #852 — since they land on the same lines. I trial-merged all six chat PRs onto Whichever of the five merges first, the other four need a rebase. Two shared anchors cause it. 1. #[path = "chat_registry_tests.rs"] mod registry_tests; // #848
#[path = "chat_sources_tests.rs"] mod sources_tests; // #849
#[path = "chat_fallback_tests.rs"] mod fallback_tests; // #850
#[path = "chat_persistence_tests.rs"] mod persistence_tests; // #852That one is unavoidable and cheap to resolve — keep all four lines. 2.
One step running Suggestion: let #845 keep a single step named for the module rather than for the fix, and drop the None of this is about the fixes themselves, which I am reviewing separately. #850 and #852 in particular are the same family as #845 — the chat path reporting success when something underneath it failed — and that family is worth naming. |
|
Thanks for trial-merging these and identifying the shared conflict points. Agreed — I'll follow this approach: keep one module-wide I'll also preserve all four test modules when resolving the conflicts and update the remaining branches as the PRs land. The local integration run already used that single module-wide step and retained all the tests; the individual PR branches still need that cleanup. |
554feaf to
d0d0383
Compare
|
Completed the coordination cleanup and pushed the updated branches. All nine related PR branches are rebased onto
Revalidation on isolated integration tree The duplicate 0042 validation document was also removed from #845: durable findings stay in the original ADR, and historical run tables/SHAs now live in its PR description. Its evidence-only handoff design is frozen. Per-branch current heads and the validation scope are recorded in the updated PR descriptions. |
Signed-off-by: dada-yan <BinjunYann@gmail.com>
Signed-off-by: dada-yan <BinjunYann@gmail.com>
d0d0383 to
73f5442
Compare
|
Completed and pushed the current-dev synchronization for #845, #848–#852 and #854–#856, based on The single Postgres-backed Chat command executed 47 tests, including all 37 introduced tests across seven groups. Seven deliberately filtered green Cargo runs were each rejected by the independent executed-test coverage checker. No tests were dropped to consolidate CI. Combined tree |
|
Correction to my note above: "keep all four lines" was half the advice. rustfmt also wants them sorted, so resolving in merge order fails #[path = "chat_fallback_tests.rs"]
mod fallback_tests;
#[path = "chat_persistence_tests.rs"]
mod persistence_tests;
#[path = "chat_registry_tests.rs"]
mod registry_tests;
#[path = "chat_sources_tests.rs"]
mod sources_tests;I hit this resolving the four locally — it is the resolver's trap, not a fault in any of these PRs, but whoever merges will step in the same place. Also worth reporting: I built a tree with #848, #849, #850, #851 and #852 all merged onto The combination is healthy, and the ci.yml collapse worked — the only remaining conflict is the four One thing I looked for specifically: |
# Conflicts: # crates/utopia-server/src/api/chat_empty_reply_tests.rs
Latest dev synchronization (2026-09-21)
Based on
dev@474b904dc3e8014d42404a3c067af9906036a953; current head73f5442f50cc871415aa6be90df7d85b1ef71150.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.
The legacy RAG fallback ignores an assistant-message save failure and emits done after streaming the answer. It can report success although the answer is absent from history.
Check the append result before done. On failure, retain the streamed content, log the diagnostic server-side and emit a safe error stating that saving could not be confirmed. Do not retry generation or persistence.
Linux/PostgreSQL validation uses real Chat producers, a local provider rejecting tools and a fixture-scoped trigger rejecting assistant inserts:
Only fallback persistence changes here. The agent path's save-before-publish behavior is already handled by #845 and is not duplicated. No migration, outbox, data repair, paid model or business data is involved.
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/PostgreSQL also exercised fallback after tool rejection with an assistant-only INSERT trigger failure. The generated text remains visible with the safe save-confirmation error, no assistant row is stored, internal diagnostics stay out of the page, and #851 does not turn EOF into success.