fix(sync): isolate fenced merged-conversation reprocessing#10272
Conversation
Failure-Class: FC-split-mutation-authority
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b0c269c58
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| except SyncConversationPersistenceFenced: | ||
| raise | ||
| logger.info('event=sync_conversation_reprocess outcome=fenced conversation_id=%s', conversation_id) |
There was a problem hiding this comment.
Drop fenced conversations before audio finalization
When private_cloud_sync_enabled is true and a merged conversation is fenced during reprocessing, this catch now lets the pipeline continue while the fenced conversation ID remains in response['updated_memories']; the caller then runs _finalize_sync_audio_files, which derives conversation_ids from updated_memories and writes audio_files/precache/enqueues an artifact for that same lifecycle-fenced conversation. Before this change the re-raised fence stopped before those post-processing side effects, so please remove the fenced conversation from the response (or otherwise pass a skipped set) before continuing to siblings.
Useful? React with 👍 / 👎.
Summary
supersededoutcome.Root cause and durable guard
_reprocess_merged_conversationsruns after segment persistence. Before this change, aSyncConversationPersistenceFencedfrom one conversation escaped the whole merged-conversation loop. That made an otherwise-current sync job look like a stale worker and could prevent its unaffected sibling conversations from receiving their post-merge reprocessing.The loop now treats that fence as scoped to the replaced/discarded conversation, emits a bounded event, and continues to siblings. A regression test exercises a fenced first conversation followed by a successfully reprocessed sibling.
Verification
VIRTUAL_ENV="$PWD/backend/.venv" PATH="$VIRTUAL_ENV/bin:$PATH" BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-10234-focused-tests.txt bash backend/test.sh -- -k merged_reprocess_fence_isolated_to_its_conversation -vv— 164 passed.Scope limits
backend-sync-backfilllane and retains fix(sync): terminalize fenced offline-sync workers #10235'scompleted/supersededfinalization semantics.Closes #10234
Failure-Class: FC-split-mutation-authority