Repository navigation
fix: commit LISTEN custody at pack windows while keeping live relay immediate - #23656
Merged
Merged
Conversation
Keep live relay and transcript delivery independent of raw-pack flushes. Release coverage only after the accepted original audio checkpoint commits. Failure-Class: FC-periodic-barrier-forces-window-commit
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. |
Remove the retired relay-barrier dependency from the session and runtime. Prove live socket sends continue during a blocked window upload while original bytes and pending client acknowledgements remain in custody. Failure-Class: FC-periodic-barrier-forces-window-commit
Gate consented audio coverage on accepted original frames and raw receipts. Keep consent-off coverage on its pre-custody durable transcript receipt, without claiming an empty audio archive or waiting for a forbidden upload. Failure-Class: FC-periodic-barrier-forces-window-commit
This was referenced Oct 26, 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.
LISTEN's one-second relay and transcript barriers forced a durable raw-pack flush on every cycle after #23542. The investigation reports attribute approximately 20–21k private-sync object writes/minute and +5.5M Firestore reads/hour to those commits. This change implements lead rulings e9e7ed and 316c46; it keeps the durable outbox enabled.
The relay neither waits for storage uploads nor flushes an active pack. Packs commit at their existing 60-second, conversation/hour/size, 4096-frame and disconnect boundaries. Fence, tombstone and protection reads therefore run per window; no privacy authority is cached. Original bytes remain in active/frozen packs until immutable media and manifest receipts exist. Only client custody ACKs wait behind those commits. The retired relay-barrier dependency is removed from the session/runtime together.
Transcript persistence and live STT delivery continue immediately. Coverage ledger writes and
capture_committedACKs wait behind an accepted-frame checkpoint, including earlier failed commits. A bounded queue keeps a frozen oldest snapshot and one coalesced cumulative successor per conversation, so continuous transcript arrivals cannot starve ACK progress. Queue overflow withholds the optional coverage ACK. Audio-only receipts retain their existing opt-in contract and emit only after both objects commit.Storage-consent contract (lead ruling 895e42): that raw-audio gate applies to consenting captures. With private cloud audio storage disabled or absent, preserve the pre-#23542 semantics exactly: coverage publication/WAL release follows the successful durable transcript transaction, never an empty archive checkpoint. It emits no audio-only receipt and creates no audio-storage obligation. Failed transcript persistence emits no coverage ACK. This prevents unbounded phone retention for an upload that consent forbids. With storage consent, an archive that accepted no frames cannot certify coverage.
Client WAL impact: time-to-ACK grows from roughly one relay cycle to pack completion: up to an active 60-second window plus storage latency for audio-only receipts, or an earlier boundary. A coalesced coverage snapshot can include the next pack, so coverage-based WAL release may retain into the following active window as well. An idle partial window remains unacknowledged until more audio closes the window or disconnect flushes the tail. Storage failures retain WAL through successful retry. A pod crash mid-window issues no audio/coverage ACK for uncommitted frames. Installed legacy clients' retention behavior remains a separate client compatibility constraint.
Validation (local, BasedHardware/omi task worktree):
omi-heavy run -- nice -n 19 env BACKEND_PYTEST_WORKERS=1 BACKEND_UNIT_TEST_FILE_LIST=/Volumes/Ephemeral/scratch/listencustody/tests.txt bash backend/test.sh: 194 passed across custody, capture coverage, relay-session and archive tests, rerun at the final consent delta. Covers mid-window crash, disconnect tail, out-of-order failure/retry, bounded ACK coalescing/progress, real relay sends including a deliberately blocked in-flight upload, pack boundaries, and zero storage/fence/tombstone/protection calls across 59 one-second relay gates followed by one media+manifest pair at 60 seconds. Consent regressions cover no audio writes/receipts for storage-off, legacy coverage release after durable transcript success, no release after transaction failure, and refusal to certify an empty consented archive.omi-heavy run -- nice -n 19 bash backend/testing/e2e/run.sh -q --tb=short: 135 passed, 3 skipped, 2 expected failures.Release: lead merges and rolls LISTEN in the next off-peak train. No deployment, flag flip or production data access occurs in this PR. After deployment, use ro-prod aggregate metrics to require private-sync WriteObject ~120–140k/hour and LISTEN Firestore reads <=2M/hour, with serving image/release identity and latency/custody failure checks. Savings remain unverified until that live acceptance. Rollback is a lead-approved revert/redeploy of this PR; keep
AUDIO_DURABLE_OUTBOX_ENABLEDon.Failure-Class: new
UI-Evidence: none -- reason: backend custody scheduling only; no client UI changes
Owns: listencustody