Skip to content

Backend/pusher: header_type 102 stale memory_id can overwrite active conversation_id in /v4/listen pipeline #6952

Closed

Description

@waffensam

Summary

Desktop /v4/listen sessions can be rebound to stale backend conversation IDs from older conversations.

User-visible behavior

A new desktop recording can receive an old memory_created / memory_processing_started event, get completed locally against that stale backend ID, and then fail final reconciliation when stop/finalize returns a different backend conversation.

Typical result:

  • the local session is marked completed too early against an unrelated backend ID
  • stop/finalize returns a different backend conversation ID
  • timestamp reconciliation fails
  • the local row ends up in a broken state such as failed | in_progress
  • the backend conversation often ends up as a discarded or mismatched result

Why this is distinct

This is not the same issue as #6954.

  • #6954 is about /v4/listen getting starved of audio before STT produces segments
  • this issue is about stale backend lifecycle/conversation IDs being injected into a newer recording session

It also differs from narrow post-stop reconciliation issues because the session can already be corrupted before normal stop/reconcile flow finishes.

Evidence

Current backend code still allows transcript memory_id to overwrite the authoritative active conversation ID:

  • backend/routers/pusher.py:446-457

Current test coverage still encodes that same behavior:

  • backend/tests/unit/test_listen_pipeline.py:636-644

Current transcribe-path code still forwards current_conversation_id through paths that were previously patched for rollover races:

  • backend/routers/transcribe.py:2528-2540

There is also repo history showing this exact class of bug was already fixed in earlier commits, but those fixes are not ancestors of current HEAD.

Most likely root cause

The listen/pusher pipeline is treating transcript memory_id as authoritative conversation state and allowing it to overwrite current_conversation_id.

Once a stale backend conversation ID is emitted into a fresh session, the desktop client amplifies the problem by trusting memory_created and persisting that ID immediately.

Expected behavior

  • transcript payloads should not mutate the authoritative active conversation ID for the current listen/pusher session
  • stale lifecycle events from older conversations should not be accepted as belonging to a newer recording session
  • conversation binding across reconnect / rollover should remain session-scoped and deterministic

Proposed direction

  • restore the pusher.py behavior where transcript memory_id does not overwrite current_conversation_id
  • restore or re-apply the earlier rollover-race protections (resolve_transcript_conversation_id, per-segment conversation mapping, non-stale speaker-assignment routing)
  • make /v4/listen lifecycle events session-scoped so stale events cannot complete a newer session
  • harden the desktop client so memory_created alone is not enough to complete the current local session without session correlation

Activity

  1. added
    p1
    bug
    backend
    on Apr 27, 2026
  2. added 4 commits that reference this issue on Apr 30, 2026
    f7dfb5d
    bf34c3b
    b12d962
    239401b
  3. added a commit that references this issue on Jul 10, 2026
    d89f36f
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

    backendbugp1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions