Repository navigation
fix(batch): dispatch bounded quarantine recovery batches and keep recovery polls pending - #22321
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 19, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Oct 19, 2026
#22321 made quarantined units with held/prepared/running recovery poll as processing with a nonzero hint (terminal quarantine still reports failed), and bounded recovery dispatch to 16 candidates per sweep. Three harnesses still pinned the pre-#22321 behavior and fail on main: - Sync Cloud Tasks gauntlet batch-empty-asr-recovery asserted 'failed' while recovery was pending. It now asserts processing + nonzero poll_after_ms at held, prepared and (serving-kill scenario) running, then completed. A new batch-empty-asr-recovery-failure scenario pins the terminal leg: a failing paid call settles failed_held, polls failed with poll_after_ms 0, and a duplicate delivery never re-pays. - Characterization goldens regenerated via PIPELINE_GOLDEN_UPDATE=1; every diff is the dispatch batch size (with BATCH_PIPELINE_RECOVERY_DISPATCH_BATCH_SIZE=1 the regenerated traces equal the old goldens byte for byte). - provider_exhaustion_window now asserts the fixed p95 (< 300 s, was ~1500 s) and that the one terminal paid failure fails the gate as unrecovered_quarantine. Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Oct 19, 2026
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.
Quarantine recovery previously dispatched one candidate per 20-second reconciliation pass, limiting one integration instance to about 3/min regardless of queue concurrency. Dispatch up to 16 candidates per pass (configurable 1–64), retain the global cursor, and rotate allowlisted cohorts under the same global bound. RecoveryStore.start, durable paid-intent tokens, privacy fences, and ordered merge retain their existing authority.
Recoverable quarantines (
held,prepared,running) now reportprocessingwith a nonzero poll hint. Terminal held failures still reportfailed. The poll route maps BatchPrivacyBlocked to the same HTTP 409/code/body as upload.Validation:
provider_exhaustion_window, seed 1: 132 quarantines and 132 paid calls both before/after; quarantine-to-projection p95 1,512.5s → 89.7s. Batch-size=1 rollback reproduces 1,512.5s. The unmerged sim was loaded externally; its modeled query limit was updated from 10 to 64 to match the real query. The overall after-run still fails the separate unrecovered-quarantine gate (one held job), so this is not a claim that every gate passes.nice -n 19targeted unit tests: 108 recovery/intake/quarantine cases plus 13 status-route cases passed. Firestore query guards: 479 shape cases and 30 outside-contract cases passed.bin/omi-heavy run -- nice -n 19.Rollback: set BATCH_PIPELINE_RECOVERY_DISPATCH_BATCH_SIZE=1. Existing recovery enablement and inline kill switch remain effective. No workflow changes, merge, deploy, production account data, or GCP access.
Product invariants affected
none
Failure-Class: none
Failure-Class-Reason: The primary defect is a bounded dispatcher configured below its downstream capacity; the poll changes restore the batch recovery protocol's pending/error mapping. Existing definitions do not describe that combined recovery contract. Regression guards cover bounded paging, cohort fairness, paid-start races, ordered merge, and HTTP privacy mapping.
Line-Count-Exception: backend/routers/sync.py | 2948 -> 2956 | Catch the typed privacy fence at the existing HTTP boundary and share the upload response; moving this route would broaden a recovery-only fix.