Repository navigation
Enable #22083 controls on PROD runtime services - #22099
Merged
Merged
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. |
This was referenced Oct 18, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Oct 21, 2026
…es stop looping (#23092) ## Summary Sync intake stores rule-settled "review" fragments with `discarded=True`. When the first-summary wake for such a row runs, `_reprocess_conversation_after_update` re-derives the discard verdict and calls `discard_by_relevance`, which returns `False` because the row is already hidden. The callback then returned `None` with no discard receipt, and with `FIRST_SUMMARY_PRESERVE_ADMITTED_ENABLED` (prod since #22099, 2026-10-18) `reprocess.run` raised `FirstSummaryCallbackPending` → HTTP 409 → Cloud Tasks retry with backoff → the same result on every attempt; after the attempt cap the 2-minute sweep re-created the wake. Before the flag the same path silently deleted the obligation. On 2026-10-21 backend-sync logged ~3,000 `callback_pending` retries/hour (2,990 of 3,000 sampled enrichment outcomes), every non-OK response on `sync-jobs-fresh` was an `sr-` task on its 4th–10th attempt, and the outbox held 4,839 fresh-lane + 4,792 backfill-lane obligations overdue ≥4h with no lease and no deferral. Those retries share the queue that carries every real first summary (P44 write-up: `data/run-2026-10-13-two-lane-nemotron/first-summary-finished-at-2026-10-21.md` in the workspace repo). The read predicate derives `discarded` for every uncurated review row, so the callback cannot tell a stored discard from a refused write by looking at the row; only the write's own outcome can. `database.conversations.rule_discard_outcome` now reports `discarded` (a write; cache/index side effects run), `already_discarded` (stored hide; no side effects) or `refused` (deleted, revised, curated, non-completed, missing). `discard_by_relevance` keeps its True-only-on-write contract for `scripts/conversation_relevance_backfill.py` and `test_people_stats_cache`. The pipeline receipts both `discarded` and `already_discarded` (the relevance metric is recorded only for a real write); a refusal still leaves the obligation for the next attempt to re-read, as before. ## Lane / contract Lane first-summary (P44 brief, two-lane program); contracts: none. No other lane's files edited. ## Product invariants affected none (no locked path touched). ## Verification Layer: unit (synthetic fixtures), m5, `nice -n 19`, `BACKEND_PYTEST_WORKERS=4`, via `backend/test.sh` with `BACKEND_UNIT_TEST_FILE_LIST`: - Directly affected files, 210 passed: `test_sync_reprocess_coalesce.py` (91; +3 new: the pipeline receipts an intake-discarded fragment without a second write, with and without a process context; an admitted obligation on such a row settles `processed` through the real callback instead of raising `FirstSummaryCallbackPending`; the existing persistence test now also asserts the relevance metric count), `test_rule_discard_visibility.py` (44; +2 new: the real DB function against the strict Firestore fake receipts a stored discard without rewriting it, and `rule_discard_outcome` distinguishes `discarded` / `already_discarded` / `refused` with exactly one cache invalidation), `test_owner_recognition_telemetry.py` (23), `test_people_stats_cache.py` (52, unchanged contract). - Neighbouring consumers, 720 passed: relevance backfill, free-tier matrix, mobile client journeys, owner-identity telemetry, sync cross-job assignment, enrichment custody, fragment visibility, lineage allowlist/dedupe/recording, minimal redrive, `test_sync_v2`, summary delivery, summary persistence. - `scripts/backend-python-format --check` clean on all six files. - NOT run locally: the full backend unit suite (CI selects it because `database/conversations.py` changed), integration/emulator suites, and any live layer. No deploy; the fix is dark until the next train. ## Rollback Revert. No flag: the new tri-state is internal to the discard write; `discard_by_relevance` is unchanged for its callers. Failure-Class: FC-permanent-write-rejection-retried-forever Line-Count-Exception: backend/database/conversations.py | 4475 -> 4501 | rule_discard_outcome must live beside discard_by_relevance: the strict-store tests monkeypatch this module's db, cache and index seams, and the relevance backfill keeps the bool wrapper Line-Count-Exception: backend/utils/sync/pipeline.py | 3644 -> 3647 | the rule-discard branch of the callback that owns it now branches on the write outcome <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23092?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23092?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23092&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
tivince82
pushed a commit
to tivince82/omi
that referenced
this pull request
Oct 21, 2026
…es stop looping Intake stores rule-settled review fragments with discarded=True. When the first-summary wake for such a row runs, _reprocess_conversation_after_update re-derives the discard verdict and calls discard_by_relevance, which returns False because the row is already hidden. The callback then returned None without a discard receipt, and with FIRST_SUMMARY_PRESERVE_ADMITTED_ENABLED (prod since BasedHardware#22099, 2026-10-18) reprocess.run raised FirstSummaryCallbackPending: a 409, a Cloud Tasks retry with backoff, and the same result on every attempt. After the attempt cap the sweep re-created the wake. Before the flag the same path silently deleted the obligation. On 2026-10-21 backend-sync logged ~3,000 callback_pending retries per hour (2,990 of 3,000 sampled enrichment outcomes), every non-OK response on sync-jobs-fresh was an sr- task on its 4th-10th attempt, and the outbox held 4,839 fresh-lane and 4,792 backfill-lane obligations overdue for 4h+ with no lease and no deferral. Those retries share the queue that carries every real first summary. The read predicate derives `discarded` for every uncurated review row, so the callback cannot tell a stored discard from a refused write by looking at the row. database.conversations.rule_discard_outcome now reports the write's own outcome: `discarded` on a write, `already_discarded` for a stored hide (no cache or index side effects), else `refused`. discard_by_relevance keeps its True-only-on-write contract for the relevance backfill script. The pipeline receipts both `discarded` and `already_discarded`; a refusal (revised, curated, deleted) still leaves the obligation for the next attempt to re-read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FIRST_SUMMARY_PRESERVE_ADMITTED_ENABLEDon PROD Cloud Runbackend-integration,backend-sync, andbackend-sync-backfill.BATCH_PIPELINE_READ_ONLY_METRICS_ENABLEDandBATCH_PIPELINE_PROJECTION_TIMING_ENABLEDonly on PRODbackend-integration.backendoff; add no allowlist bindings.Product invariants affected
Verification
nice -n 19 backend/.venv/bin/python scripts/check_feature_flag_registry.py— passed.nice -n 19 backend/scripts/check_runtime_env_compose.sh— passed.nice -n 19 backend/scripts/pre-deploy-check.sh— passed, 315 tests.nice -n 19 make preflight— passed, 20 checks.This PR changes the PROD manifest only; it has not been deployed.