Skip to content

fix: commit LISTEN custody at pack windows while keeping live relay immediate - #23656

Merged
Git-on-my-level merged 4 commits into
mainfrom
lane/listencustody
Oct 26, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
lane/listencustody

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

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_committed ACKs 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.
  • Additional preflight/static results are recorded in the lane handoff.

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_ENABLED on.

Failure-Class: new
UI-Evidence: none -- reason: backend custody scheduling only; no client UI changes
Owns: listencustody

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T02:48:20.899804Z 5133fc7 New commits
ℹ️ 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" or "@codex security review".

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

1 participant