Repository navigation
fix: preserve admitted first summaries across batch rollback - #22083
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a8c66da38
ℹ️ 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".
| context = PROCESS_CONTEXT.get() | ||
| if context is not None: | ||
| context['discarded'] = True |
There was a problem hiding this comment.
Receipt already-completed rule discards
When preservation is enabled after a cohort rollback, a rule discard that was committed by another worker—or committed before this process crashed—is not treated as terminal because discard_by_relevance returns False for an already-discarded row and this context flag is set only for a new write. The callback then returns None, reprocess.run raises FirstSummaryCallbackPending, and every retry encounters the same already-discarded state, leaving the outbox on its short retry cadence indefinitely. Verify the latest lifecycle state when the conditional write returns false and receipt an already-discarded matching revision while still retaining debt for revision or user-curation conflicts.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b79c15af86
ℹ️ 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".
| if output is None and preserves_admitted(row) and not discarded and not blocked: | ||
| raise FirstSummaryCallbackPending('first-summary callback has no output yet') |
There was a problem hiding this comment.
Settle preserved debt when its conversation is deleted
When preservation is enabled after a cohort rollback and the conversation is deleted between outbox admission and processing, _reprocess_conversation_after_update returns None for that terminal lifecycle state, but this condition treats it as a pending callback and raises before finish can remove the outbox. Because the deleted conversation can never produce output, every sweep will keep redispatching the obligation indefinitely; distinguish terminal missing/deleted rows from genuinely pending callbacks and settle their debt.
Useful? React with 👍 / 👎.
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdd11c3edc
ℹ️ 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".
| - {"key":"BATCH_PIPELINE_PROJECTION_TIMING_ENABLED","aliases":[],"kind":"env","lifecycle":"rollout","surfaces":["backend"],"summary":"Default false; content-free monotonic start finish and error timings for batch projection phases","fail":"closed","owner":"dazheng","created":"2026-10-18","review_by":"2026-11-17","decision":"pending"} | ||
| - {"key":"FIRST_SUMMARY_PRESERVE_ADMITTED_ENABLED","aliases":[],"kind":"env","lifecycle":"rollout","surfaces":["backend"],"summary":"Default false; preserve existing first-summary deadlines and output obligations across cohort rollback while the deadline master remains on","fail":"closed","owner":"dazheng","created":"2026-10-18","review_by":"2026-11-17","decision":"pending"} | ||
|
|
||
| - {"key":"BATCH_PIPELINE_WORKER_SILENCE_DISPOSITION_ENABLED","aliases":[],"kind":"env","lifecycle":"rollout","surfaces":["backend"],"summary":"Default off; empty-ASR worker jobs reuse integration strict local VAD to commit confirmed silence before quarantine","fail":"closed","owner":"dazheng","created":"2026-10-18","review_by":"2026-11-17","decision":"pending","notes":"Worker-only Helm worker.workerSilenceDispositionEnabled=false. Reuses recovery_disposition.inspect_audio and silence_payload; speech-positive or invalid inspection retains quarantine and multilingual recovery. Rollback sets the worker flag false. See backend/diarizer/batch_pipeline_runtime.md."} |
There was a problem hiding this comment.
Restore the flag entry's list indentation
Indent this entry beneath flags: like the surrounding items. At column zero it starts a root-level sequence immediately after the root mapping, so standards-compliant YAML parsers reject the entire registry; for example, backend/tests/unit/test_conversation_smart_merge_wallclock_runtime.py loads this file with yaml.safe_load, which now fails before the test can run.
Useful? React with 👍 / 👎.
What changed and why
After a batch percentage rollback, an existing first-summary outbox deadline loses its short scheduling/lease/output policy when its owner leaves the current cohort. A callback returning no output can then delete that obligation while the conversation still carries overdue summary debt. Add a default-off
FIRST_SUMMARY_PRESERVE_ADMITTED_ENABLEDcontrol that retains the policy for existing finite deadlines, scopes eligibility through processing/persistence, and retains missing-output debt without consuming the empty-model-result budget. New out-of-cohort conversations, effects-only work and later revisions keep existing behavior; the deadline master switch remains authoritative.Also add independent dark controls to stop authenticated metrics scrapes from invoking the full reconciler while the supervised drain is enabled, and emit content-free projection phase timings. These reduce a source of overlapping projection contention and expose the remaining bridge/playback/assignment wait. Predecessor ordering, sibling completion, privacy fences, provider recovery and worker silence policy are unchanged. All controls default off in the runtime manifest and Helm values.
Read-only incident evidence separates settlement→ordered commit (up to 494s in retry), commit→persistence (up to 681s), and scheduling debt lost after a task had already been armed. The same cohort gate also controls summary receipt writes, so absent receipts after rollback do not prove body absence; no body was read. This PR preserves the admitted callback receipt policy too. This PR is a bounded mitigation and scheduling correctness fix; it does not establish a production p95 or qualify the ramp. No production writes, deploy, replay, provider calls or account-content reads were performed.
Product invariants affected
INV-MEM-4: processing and persistence keep the existing canonical promotion, privacy and ownership fences; summary eligibility changes scheduling only.
How it was verified
omi-heavy run -- nice -n 19, file-isolated pytest frombackend/: reprocess/cohort rollback, projection, serving HTTP route, summary delivery.backend/scripts/pre-deploy-check.sh, focused Python type checks, and repositorymake preflight.Tests
test_sync_reprocess_coalesce.pycovers rollback/no-output retention, context cleanup, invalid deadline rejection, demand bypass and short repair without token rotation.test_batch_pipeline_serving.pycovers the concurrent HTTP scrape and default-off/serving-off rollback behavior.test_batch_pipeline_projection.pycovers error-preserving phase timing with no private exception or binding output. Runtime-env fixtures include the new dark defaults. Job-identity fixtures use the safe C YAML loader, and the speaker deadline fixture uses a deterministic virtual clock; assertions and timing limits remain intact. The rendered pusher contract explicitly pins all three new controls false.UI-Evidence: none -- backend scheduling and diagnostics only
Failure-Class: FC-split-mutation-authority
Line-Count-Exception: backend/utils/sync/pipeline.py | 3415 -> 3418 | Carry the already-persisted rule discard into the summary callback context so admitted debt can settle without another database read.