Skip to content

One ungrounded memory candidate aborts the whole conversation: ~1 in 3 lazy enrichments fails on 'evidence without a unique source binding' #11685

Closed

Description

@kodjima33

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 enrich outcomes 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_items and _update_goal_progress never run;
  • the lazy-enrich handler (routers/conversations.py:129-135) marks the conversation deferred: True again — no summary for the user until they reopen it;
  • persist_desktop_meeting_arrival_best_effort is 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

  1. added
    bug
    on Aug 16, 2026
  2. kodjima33 commented on Aug 16, 2026

    @kodjima33
    CollaboratorAuthor

    Fixed and merged: #11688 → 5af7e53fd7 on main.

    Verified before merge: the new regression test test_canonical_capture_drops_only_the_ungrounded_candidate fails on the pre-fix process_conversation.py with the verbatim production ValueError and passes with the fix; 5 related backend test files (36 tests) pass; make preflight green (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.yml prod deploy (merge only auto-deploys development). The evidence to close on: the lazy enrich failed … evidence without a unique source binding rate in based-hardware dropping to ~0 after that deploy, with lazy enrich complete rising correspondingly.

    🤖 automated by hourly watchdog — tested and merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions