Skip to content

fix(listen): bind recordings by client identity - #9349

Merged
Git-on-my-level merged 2 commits into
mainfrom
codex/recording-session-binding
Jul 9, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
codex/recording-session-binding

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #6952.

A new desktop recording could inherit a stale user-global in-progress conversation. That made a fresh recording’s lifecycle events and finalization path attach to the wrong conversation.

This is the compatibility-preserving first phase of the Oracle prescription:

  • Treat a supplied client_conversation_id as the authoritative recording identity; it never falls back to the user-global in-progress pointer.
  • Propagate that identity as recording_session_id on listen lifecycle events and suppress non-current callbacks.
  • Bind desktop sessions and accept lifecycle events only when their exact recording identity matches; retain timestamp matching only for legacy, unidentified sessions.
  • Refuse stale persisted backend bindings during finalization and reconcile the exact client recording ID instead.

Why

The old protocol conflated an advisory client ID, a user-global “currently recording” pointer, and a conversation ID. The result was a causal-identity failure: late or stale work could be delivered as though it belonged to the latest desktop recording.

Long-term follow-up

This deliberately does not introduce a broad storage migration. The next architectural step—tracked in #9351—is a server-owned recording-session resource with a stable recording ID, an event envelope (recording_session_id, conversation ID, sequence/generation), and idempotent finalize semantics. That makes conversation mapping an explicit state machine rather than an inference from global state, timestamps, or WebSocket order.

Validation

  • cd backend && ./.venv/bin/pytest testing/e2e/test_listen_stt.py -q — 9 passed
  • cd desktop/macos && xcrun swift test -c debug --package-path Desktop --filter StopReconciliationTests — 37 passed
  • cd desktop/macos && xcrun swift test -c debug --package-path Desktop --filter TranscriptionFinalizationStateMachineTests — 23 passed
  • cd backend && ./.venv/bin/pytest tests/unit/test_prompt_cache_integration.py -q — 25 passed
  • cd backend && ./.venv/bin/python scripts/scan_async_blockers.py — 0 selected findings
  • cd backend && ./.venv/bin/python scripts/check_module_stub_pollution.py — 0 violations
  • Built and ran isolated omi-recording-binding; exercised capture start, transcript injection, and stop through the in-process automation bridge.

The broad desktop suite still has an unrelated Firebase initialization crash in LiveNotesMonitorTests. The backend aggregate suite also hit unrelated CPU-duration gates under concurrent load; the affected prompt-cache file passes in isolation.

@mintlify

mintlify Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 9, 2026, 8:09 PM

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

@Git-on-my-level
Git-on-my-level marked this pull request as ready for review July 9, 2026 20:07
@Git-on-my-level
Git-on-my-level marked this pull request as draft July 9, 2026 20:10
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review July 9, 2026 20:17
@Git-on-my-level
Git-on-my-level merged commit d89f36f into main Jul 9, 2026
22 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/recording-session-binding branch July 9, 2026 21:15
Git-on-my-level added a commit that referenced this pull request Jul 9, 2026
…t formatting

Merge conflict left bare 'useLocalSTT' at line 66 (added by #9349 in main).
Migrated to 'sttSession.useLocalSTT' per the PR's W6 STTSessionState refactor.
Also restored Dart files to origin/main formatting (pre-commit hook had
reformatted them during merge).
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.

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

1 participant