Skip to content

fix(sync): isolate fenced merged-conversation reprocessing#10272

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:fix/sync-reconcile-superseded-10234
Jul 22, 2026
Merged

fix(sync): isolate fenced merged-conversation reprocessing#10272
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:fix/sync-reconcile-superseded-10234

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Isolate a lifecycle fence raised while reprocessing one merged offline-sync conversation.
  • Continue reprocessing sibling conversations so a valid current sync job can complete rather than being turned into a stale-worker superseded outcome.
  • Preserve the lifecycle fence: the fenced conversation emits no stale completion side effects and is not retried or recreated by this worker.

Root cause and durable guard

_reprocess_merged_conversations runs after segment persistence. Before this change, a SyncConversationPersistenceFenced from 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.
  • Full preflight and PR metadata preflight: pending at PR creation time.

Scope limits

  • No stale-worker side effects, client retry protocol, scheduler, or unbounded data scan is introduced.
  • Existing historical backfill continues through the backend-sync-backfill lane and retains fix(sync): terminalize fenced offline-sync workers #10235's completed/superseded finalization semantics.

Closes #10234

Failure-Class: FC-split-mutation-authority

Review in cubic

Failure-Class: FC-split-mutation-authority

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 1290 to +1291
except SyncConversationPersistenceFenced:
raise
logger.info('event=sync_conversation_reprocess outcome=fenced conversation_id=%s', conversation_id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit cc84cef into BasedHardware:main Jul 22, 2026
33 of 36 checks passed
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.

Reconcile superseded offline-sync jobs without stale-worker retries

1 participant