Repository navigation
v3: Finish ends the live window when the recording has no in-progress pointer - #26242
Merged
Git-on-my-level merged 4 commits intoNov 24, 2026
Merged
Git-on-my-level merged 4 commits into
Git-on-my-level merged 4 commits into
Conversation
Failure-Class: none Co-Authored-By: Codex <[email protected]>
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Failure-Class: none Co-Authored-By: Codex <[email protected]>
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Failure-Class: none Co-Authored-By: Codex <[email protected]>
Failure-Class: none Co-Authored-By: Codex <[email protected]>
This was referenced Nov 24, 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.
DESIGN
After both existing recording lookups miss, an authenticated v3 owner can Finish a live derived window. An optional
live_conversation_idis checked in the owner's collection against the same liveness and visibility rules, with a transactional recheck before any write. An invalid or stale hint falls back to the existing bounded live lookup. Empty requests keep working.Finish writes the cut and builder wake on a closed recording with available speech. For server-batch captures, it reads the deterministic native projection ledger under the same transaction. A complete whole-record receipt allows an immediate cut, including on a repeat tap with a deferred marker. An unfinished full recording stores one deferred request. Single-unit admission and projection keep their existing rules. Multi-unit completion consumes the request in the existing ledger transaction only after every unit has a ready receipt. The completion write and durable builder wake commit together. A partial archive or explicitly incomplete ledger cannot authorize the cut.
The route uses the existing owner-scoped native ledger at the deterministic record identity. Its batch protocol, native job ID, binding and completed result are the proof. The writer verifies the binding and every sibling's ready receipt before committing that result, so older ledgers work without a separate processed-segment list. Whole-record completion also resolves terminal silence. It cuts a matching live window that still has speech, or clears the request and retains its window ID for a terminal acknowledgement on repeat. Terminal silence can add one recording read if the output snapshot is absent and one masked window read for a pending request.
A stored request is reusable only while its request flag is true and its window ID matches. A different pending request is retargeted only when the recording's stored claims prove the requested window owns the unique latest end and the previous window has an earlier claim. If that proof is missing or ambiguous, the endpoint returns 404 and preserves the pending request. A resolved marker can be rearmed for pending batch work and does not count as a consumed request on a fresh cut.
A lookup miss adds the existing live query (usually a few documents, capped at 200), or one by-ID read for a usable hint. It adds at most two transaction document reads per attempt for the live row and its source, plus one ledger read for server-batch recordings. A stale hint can add one attempted lookup and transactional recheck before fallback. Each Finish writes at most one recording. Whole-record completion uses the projection's existing output snapshot and adds at most one recording update and one named builder wake for a pending request. No request-side provider calls are added.
Compare unique acceptances (
cutplusrequested) with first successful settlements (settled) for the accepted window IDs inomi_conversations_v3_finish_no_pointer_total, allowing for the projection and summary drain time. Trackconsumedfor deferred requests converted to a cut by a repeat tap or whole-record completion. Trackresolved_emptyseparately for accepted requests that found no remaining speech. Repeated acknowledgement outcomes are excluded from the denominator. Also compare HTTP 404 share for POST /v1/conversations with the supplied 10:45 UTC baseline of 18/30, and check 5xx and end-to-summary latency.What changed and why
Mobile Finish and v3 End can reach the backend after quiet rotation closed the source recording. The existing in-progress Firestore lookup excludes derived windows and could return a 404 while a v3 window was still live. Finish now uses the authenticated owner's live window and persists its manual end. App PR #26241 can optionally send that window's ID.
SCA-4084 identified a race where a multi-unit request could arrive after the admission snapshot. The native projection completion transaction now consumes it after all sibling receipts are ready, including terminal silence. The route recognizes the completed ledger the native writer already persists. Single-unit projection keeps its existing whole-native-record guard. The response-only processing status is declared in the lifecycle writer inventory.
Cost
The request adds a bounded owner-scoped lookup and at most one small write. Only native server-batch cases add a ledger read. Multi-unit completion reuses its existing output snapshot and adds at most one write and one reconcile wake. No request-side STT or LLM calls are added.
Rollout and rollback
Default on for v3 owners. Set
CONVERSATIONS_V3_FINISH_NO_POINTER=offon the serving API to restore lookup-miss 404s. Accepted intents continue through the normal builder and batch pipeline. Both serving GMP profiles exportomi_conversations_v3_finish_no_pointer_total.How it was verified
The registered FastAPI route is exercised with synthetic owner data and strict Firestore transaction fixtures. Tests cover the optional ID and empty-body requests, owner isolation, the kill switch, the late multi-unit request, whole-record completion, post-projection retries, silent whole-record completion, both kill switches, native-ledger readback, and first-settlement counting. All 2,331 tests across the six focused files passed through
omi-heavy, including 1,993 lifecycle writer guard cases. The generated app-client OpenAPI and TypeScript contracts were refreshed and the directional compatibility check passed.Tests
backend/tests/unit/test_lifecycle_state_table_writers.pybackend/tests/unit/test_episodes_finalize_paths.pybackend/tests/unit/test_batch_pipeline_projection.pybackend/tests/unit/test_batch_pipeline_live.pybackend/tests/unit/test_conversations_v3_created_delivery.pybackend/tests/unit/test_conversations_v3_live_capture.pyProduct invariants affected
none
UI evidence
UI-Evidence: none -- backend contract and projection changes
Failure class (fixes)
Failure-Class: none
Line-Count-Exception: backend/routers/conversations.py | 3168 -> 3172 | The existing Finish route calls the isolated v3 fallback on its lookup miss.
Line-Count-Exception: backend/utils/batch_pipeline/projection.py | 1944 -> 1947 | The batch binding proves the projection carries the whole native recording before a marker is promoted.
Line-Count-Exception: backend/database/batch_pipeline_projection.py | 1427 -> 1508 | Deferred Finish uses the existing whole-record completion transaction and shares its sibling receipt and write fences.