Repository navigation
Description
Canonical memory extraction aborts the whole conversation when one L1 candidate fails quote grounding, so conversation finalization dies with it. In prod this is the single largest cause of failed enrichment right now.
Symptom (prod, based-hardware, 2026-08-16 03:00Z → 15:30Z):
ERROR:routers.conversations:lazy enrich failed uid=<redacted> conv=<redacted>:
canonical memory extraction returned evidence without a unique source binding
ERROR:utils.sync.pipeline:sync: failed to reprocess merged conversation <redacted>:
canonical memory extraction returned evidence without a unique source binding
lazy enrichoutcomes in that window: 42 complete / 39 failed, and 27 of the 39 failures are this one error. So ~1 in 3 of all lazy enrichments dies here.- Same error also fires continuously on
backend-sync(_reprocess_merged_conversations), where it leaves the merged conversation's summary/structured/speakers stale. - Meanwhile extraction is not systematically broken: in the same window 332 conversations saved ≥1 canonical memory (209 of them saved ≥2) and 468 extracted none. Grounding succeeds routinely — it fails per candidate.
Root cause — backend/utils/conversations/process_conversation.py:912-918:
for candidate in extracted_candidates:
evidence_quotes = _grounded_l1_evidence_quotes(candidate.evidence_quotes, conversation.transcript_segments)
if not evidence_quotes:
raise ValueError("canonical memory extraction returned evidence without a unique source binding")_grounded_l1_evidence_quotes returns [] when any one quote of that candidate does not match exactly one transcript segment — 0 matches (the model paraphrased, or quoted across a segment boundary) or 2+ matches (a short phrase repeated in two segments). That is a per-candidate trust verdict, but it is raised as a whole-run failure.
Blast radius of the raise. _extract_memories is called synchronously near the end of process_conversation (:1532), so the exception takes down everything after it as well:
- the run's other, correctly-grounded candidates are discarded;
_save_action_itemsand_update_goal_progressnever run;- the lazy-enrich handler (
routers/conversations.py:129-135) marks the conversationdeferred: Trueagain — no summary for the user until they reopen it; persist_desktop_meeting_arrival_best_effortis skipped, so the desktop meeting Chat receipt is never published;- on the sync path there is no retry at all — the merged conversation just keeps its stale enrichment.
Why the fence itself is right, and what should change. Refusing to write a memory whose evidence cannot be bound to one source segment is correct and should stay. Dropping that candidate enforces the same invariant — nothing unbound is ever written — without destroying the run. The one case that must still fail closed is every candidate failing to ground: replace_conversation_memories is called unconditionally at :1012, so continuing there would submit an empty replacement and retract the source's existing memories on the basis of a run we just decided not to trust.
Activity
fix(backend): drop only the ungrounded memory candidate, not the whol…
kodjima33 commentedon Aug 16, 2026
Fixed and merged: #11688 →
5af7e53fd7onmain.Verified before merge: the new regression test
test_canonical_capture_drops_only_the_ungrounded_candidatefails on the pre-fixprocess_conversation.pywith the verbatim productionValueErrorand passes with the fix; 5 related backend test files (36 tests) pass;make preflightgreen (24 checks); all 27 required PR checks green.Not yet closing — this is a live prod incident and the repo closes those on live evidence. The fix reaches prod on the next
gcp_backend.ymlprod deploy (merge only auto-deploys development). The evidence to close on: thelazy enrich failed … evidence without a unique source bindingrate inbased-hardwaredropping to ~0 after that deploy, withlazy enrich completerising correspondingly.🤖 automated by hourly watchdog — tested and merged
fix(backend): declare opposite-direction Firestore list-scan indexes …