Skip to content

fix: persist taught speaker identities across sessions - #14842

Merged
Git-on-my-level merged 2 commits into
mainfrom
codex/persistent-speaker-identity-20260919
Sep 19, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
codex/persistent-speaker-identity-20260919

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Problem

A person label could be written to transcript segments without producing a durable, versioned person profile. The first concrete broken boundary was between label assignment and profile publication: sample storage and embedding storage were separate writes, and the offline cache accepted legacy vectors without a version contract. A second reproduced boundary left an embedding behind when one of several samples was deleted. Adjacent short segments were also verified against only the selected segment text, so valid expanded speech was rejected before persistence.

Related issues: #7187, #5625, #4455, #5266. PRs #12893 and #12935 are already merged; this change builds on the current code instead of repeating them.

Change

  • Publish a verified person sample, transcript, embedding, speech_samples_version: 3, and source conversation/segment IDs in one Firestore transaction fenced by the person update version.
  • Replace old profiles coherently, delete superseded sample blobs, and invalidate/fence profiles when labels are corrected, samples are deleted, or the person disappears.
  • Reject foreign-person bulk assignments and prevent adjacent sample expansion from crossing person/user boundaries.
  • Require version 3 profiles for offline embedding cache loading and make missing-embedding recovery version-fenced.
  • Add synthetic backend regression coverage for restart/live matching, offline sync, account isolation, same-ID cross-account isolation, correction/deletion, failed re-teaching, and in-flight races.
  • Add a hermetic mobile journey proving a cached person name renders in later and offline-synced conversations after provider reload.
  • Update the legacy summary fixture to mock the current duplicate-capture helper used by production.

No model, language threshold, production setting, or customer data was changed.

Verification

  • make preflight — 31 checks passed.
  • BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-speaker-backend-tests.txt BACKEND_PYTEST_WORKERS=4 bash backend/test.sh — all 12 selected backend files passed (including the new persistence suite).
  • backend/.venv/bin/python -m pytest backend/tests/unit/test_taught_speaker_persistence.py backend/tests/unit/test_speaker_identification_language_fallback.py backend/tests/unit/test_speaker_person_embedding_recovery.py -q — 19 passed.
  • (cd backend && PYTHON=.venv/bin/python bash scripts/typecheck.sh) — 0 errors (5997 existing warnings).
  • backend/.venv/bin/python backend/scripts/check_unit_test_discovery.py — 1166 selected, 56 policy-covered, 0 orphans.
  • PATH=/Users/dazheng/fvm/versions/3.44.5/bin:$PATH make mobile-verify ARGS='fast --filter j6' — 3 executed, 3 passed.
  • (cd app && /Users/dazheng/fvm/versions/3.44.5/bin/dart analyze integration_test/journeys/j6_persisted_speaker_name_test.dart) — no issues found.
  • git diff --check — passed.

Remaining checks

Physical-device microphone capture, provider quality on real voices, and deployment/runtime verification remain for the mobile release lane. This branch is left reviewable locally and has not been merged or deployed.

Failure-Class: FC-split-mutation-authority
Line-Count-Exception: backend/database/users.py | 2285 -> 2342 | atomic person speech-profile replacement and invalidation transactions
Line-Count-Exception: backend/routers/conversations.py | 2231 -> 2249 | authenticated person validation and correction invalidation at the assignment boundary

Publish a verified person sample, transcript, embedding, version, and source
provenance through one fenced transaction. Invalidate corrected or deleted
profiles, isolate account caches, and cover fresh live sessions plus offline
sync with synthetic regression fixtures.

Failure-Class: FC-split-mutation-authority
@mintlify

mintlify Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Sep 19, 2026, 8:31 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant