Repository navigation
v3: Finish cuts the just-sealed capture a non-live named window points to (SCA-4385) - #26361
Merged
Merged
Conversation
…oints to A pendant capture seals at a speech pause and its window stops being live before the Finish tap lands. The app names that window, so the request skipped the recording fallback and returned 404, and the short window stayed hidden. Finish now reads the named window's tail (or the named capture), applies the recording-Finish checks within RECENT_FINISH_AGE, rechecks the live horizon and deletion marker, and stores the cut. A body naming only the live window may also use the single recent-capture fallback. SCA-4385, SCA-4084. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[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. |
…e windows Review of #26361. A capture that sealed after the named window's tail is the speech the person just finished (its window can stay hidden and never go live), so the named Finish now scans the bounded recent sources in the same transaction and cuts the newest capture, declining when it cannot be told apart. A completed window already on Home answers already_visible and writes nothing instead of regenerating its notes. The named window must not be private or merged, a window tail must carry that window's claim, and a null live_conversation_id behaves like an empty body. SCA-4385, SCA-4084. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
… keeps the card Delta review of #26361. A speech-pause rotation writes the next capture in progress, with a later clock, before it seals the one the person finished, so counting it made the named Finish decline (named_superseded) and the unnamed fallback ambiguous: the 404 this change set out to remove. Only completed recordings now supersede or compete. The already_visible answer reads the card fields and goes through the live tile's read projection, so the row the app upserts over the visible card keeps its title, overview and starring. SCA-4385, SCA-4084. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Nov 26, 2026
Resolve conflicts with the named-window Finish (#26361), the end_open_conversation End cut and the moved v3 live Finish code: - finish.py: keep main's named Finish, _recovered and outcome sets; the deliberate-Finish observer now also fires on the named path. Outcomes are matched after stripping named_/newer_/dual_ prefixes, so named_* counts now and newer_*/newer_dual_* (#26419) will once that lands. - outline.py: keep main's owner-level cuts and ends(); cut sources are looked up per cut instant, and an owner End cut carries the recording marks it answered. - service.py: _reconcile_groups is async and loads main's owner cuts. - routers/conversations.py: keep main's ended_at/Response params, End answer and finish_only_body; bind the Finish alongside them. - app: send X-Omi-Ended-At and X-Omi-Finish-Cut together; regenerate the perf production shell hash. - Replace a stale delivery test that patched a removed import with a direct test of the Home-projection summary observer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Nov 27, 2026
…s tail (#26419) ## Summary When Finish resolves to a live v3 window and a capture sealed after that window's last speech, Finish now also finishes that newer capture. Before, it cut only the window's tail. The bug was reproduced by pipeline-lab `finish_after_second_close` (#26389): 1. Recording A seals. 2. Recording B seals about two minutes later. B is a pendant or server-batch capture still waiting on its transcript, so no window lists it in `v3_recording_ids`. 3. The user taps Finish. A's window was still live: idle 125 s, inside `live.MAX_IDLE` = 2 h. So `finish_live_window` called `request_finish` on that window, which cut `members[-1]` = A. B got neither the manual-end cut nor a fast finish, and a short B stayed hidden under the Home word floor. The #26288 single-capture fallback and the #26361 named-window path both run only when no window is live. ## DESIGN **Reads and writes.** This changes only the live-window Finish transaction, with `CONVERSATIONS_V3_FINISH_NEWER_CAPTURE` on. - **Reads** (on top of main's window and tail-recording reads): - the existing `_recent_finish_sources` query: at most 8 documents, 1 billed read when empty; - when a newer capture qualifies, the account-deletion marker, then by path: | Path | Extra reads after the marker | | --- | --- | | Live-lane capture moved to | none | | Server-batch capture whose speech landed (`newer_recording_*`) | **B's native ledger, 1 read** (`_finish_capture` → `_native_projection_state`, since `newer_state` is None) | | Marked capture, pending-retry (a later tap on a still-requested batch B: `newer_already_requested` / `newer_consumed`) | **B's native ledger, 1 read** (same call) | | Stored both (`newer_dual_*`) | **2 ledger reads**: B's, plus A's when A is batch. A's is the read the tail cut always made, now ahead of both writes | | Selected, then declined | that path's ledger read; the tail's own batch ledger read is unchanged | Pinned by `test_server_batch_redirect_reads_the_capture_ledger_once`, `test_marked_pending_retry_reads_the_capture_ledger_once`, `test_stored_both_reads_each_ledger_once_before_any_write` (exact ordered read paths). - **Settlement:** none added. The Finish-to-visible sample is read from the derived row `settle_processing` already reads. - **Writes:** - **up to 2 documents** in the stored-both case: A's window-tail cut and B's recording-scoped request; - otherwise exactly 1, as before; - the Finish stamp (`v3_finish_requested`) rides in the write the transaction already makes, and the planner carries it in the derived-row write it already makes: **no added write**. - Off means the transaction is main's, plus the `tail` stamp in its existing write. - **Provider cost:** storing B's request makes B a fast-finish candidate. That adds at most one fast-finish pass per stored-both Finish, even when B turns out silent. - **Chunked (the default since #26344, production `on`):** each unit is split into chunks of at most 5 min with 3 s of overlap, sent concurrently. A B of up to 20 min (`MAX_SECONDS`) is a few prerecorded requests; the lab's 80 s B is one (STT 0 → 1). - **Chunking off:** one request per unit, at most `MAX_UNITS` (8), up to 20 min. - **Bounds:** - `CONVERSATIONS_V3_FAST_FINISH`: `cohort` by default, but production runs `on` for the services that serve Finish and admission, so the cohort does not limit it there. - A B over 20 min runs only for the long canary: `CONVERSATIONS_V3_FAST_FINISH_LONG_PERCENT` (25 in production) and `CONVERSATIONS_V3_FAST_FINISH_LONG_DAILY_SECONDS` (7200 s of such audio per UTC day across the fleet in production). That is the only fast-finish daily cap; a long pass reserves its planned seconds before any spend. - The shared funding gate (`fast_finish.funded` → `sync_admission(lane='batch')`): consent and the owner's funded STT plan allowance. **Production readback:** 1. `omi_conversations_v3_finish_no_pointer_total` by `outcome` for the `newer_*` and `newer_dual_*` labels, against the tail path's `cut` / `requested`. That shows how often Finish finds a newer capture and which branch it takes. 2. **The share of Finishes whose response target becomes visible within 60 s:** `omi_conversations_v3_finish_to_visible_seconds{path}` (`tail` / `newer` / `newer_dual`), `le="60"` bucket over `_count`, compared by path. One sample per Finish, at the response target's first visible manual-end settlement; kept by the sync scrape profile. 3. `omi_conversations_v3_finish_newer_declined_total{reason}`: how often a selected newer capture declined and the tail answered. ## Change - `database/conversations_v3_live.py` - `request_finish(..., newer_capture=False)` gets a new parameter. When it is true, the transaction runs the existing `_recent_finish_sources` scan after its two document reads and before any write. - `_newer_capture()` selects the capture. A capture qualifies when it: - is a sealed Listen capture; - ended strictly after the window's `finished_at`; - is not one of the window's sources; - carries `has_content` (a projection that landed empty clears it); - passes `_capture_ineligible(row, now)`: sealed within `RECENT_FINISH_AGE`, unclaimed, not marked for another window, not private, deleted, discarded, locked, merged, partial or upload-failed. The newest qualifying capture wins, as in `_latest_capture`. The account-deletion check (`_account_deleting`, shared with `_live_window_or_deleting`) runs before any write. - **B's speech has landed** (a live-lane capture with `has_finish_content`, or a batch capture whose projection landed): redirect only. B gets the recording-scoped cut or request through `_finish_capture`, and the response names B. Outcomes are `newer_recording_cut` / `newer_recording_requested`. - **B is a server-batch capture whose projection has not landed** (`_batch_speech_landed`). It may hold only silence: the session's last capture often does, after the quiet timeout seals A and the device stop seals B. The same transaction: - stores A's window-tail cut, exactly what main stores; - stores B's recording-scoped request. Both ledger reads come first. `_finish_window_tail` and `_finish_capture` take a pre-read `state=`, and StrictFirestore enforces the order in tests. The response names **A's window**, because the cut landed there. The outcome is `newer_dual_<tail outcome>`. - Silent B: A is cut at once, as on main, and B's request clears at whole-record completion. - Speech B: A is cut and B's request becomes B's own manual end, so B shows as its own card. - **Why not `has_finish_content` for batch B?** In production it is true for almost every batch capture right after creation. `create_in_progress_conversation` → `mark_new` stamps `v3_speech_landed_at` at creation (`utils/conversations/v3/triggers.py:61-69`), and audio custody sets `has_content` on any committed audio (`database/server_batch_audio.py:60`). So a batch capture's speech has landed only with its projection: `record_projection_revision` together with `has_content`. The lab, which creates captures through the product path, shows the same stamp. A test pins it: `created_stamp=True` fails if the check goes back to `has_finish_content`. - **The window-tail cut alone** runs unchanged when: - no capture qualifies; - two captures tie exactly on `finished_at`; - the scan is full with its oldest row still newer than the window; - `_finish_capture` declines or answers `already_empty`. It writes nothing in those cases. - **Retries never cut A twice.** - If A already carries this window's Finish (the stored-both case), the tail path answers (`already_cut` / `already_requested`) and B is not touched. - A capture an earlier recording-scoped Finish marked answers through `_finish_capture`, even if a window claimed it between taps. - If the marked capture can no longer answer (private, locked, deleted, discarded, merged, partial, upload-failed, or `_finish_capture` declines, e.g. an unavailable ledger), the **window tail is cut**. The app's `settleManualFinish` reads a 404 as "already closed", so a 404 would leave A uncut. `_finish_capture` writes nothing on those declines, so the tail cut's reads still precede every write. - A mark that resolved empty no longer holds the Finish. - Unmarked captures older than an active mark don't qualify. - `utils/conversations/v3/finish.py`: both live-window calls pass the switch. They are the empty body and a named window that is still live. `_acknowledge` counts the full label, then strips `newer_` / `dual_` to answer like the path that stored it. A window answer is what the app already settles on: `settleManualFinish` binds `_finishLiveId` to it (`app/lib/providers/conversations_v3_provider.dart:145-173`). - `config/conversations_v3.py`: `finish_newer_capture_enabled()` adds the kill switch `CONVERSATIONS_V3_FINISH_NEWER_CAPTURE`. It defaults on; off is exactly main. - `utils/conversations/v3/metrics.py`: pre-initialised labels in `omi_conversations_v3_finish_no_pointer_total`, apart from the tail path's outcomes, every one reachable: - `newer_recording_cut`, `newer_recording_requested`, `newer_already_cut`, `newer_already_requested`, `newer_resolved_empty`, `newer_consumed`, `newer_recording_ineligible` (account being deleted); - `newer_dual_cut`, `newer_dual_requested`, `newer_dual_consumed`, `newer_dual_already_cut`, `newer_dual_already_requested`, `newer_dual_already_empty`, `newer_dual_resolved_empty`. - `newer_already_empty`, `newer_batch_unavailable`, `newer_batch_disabled` could never be returned and are removed. A selected-then-declined capture counts in **`omi_conversations_v3_finish_newer_declined_total{reason}`** (`already_empty`, `batch_unavailable`, `batch_disabled`, `recording_ineligible`), once after the commit; the window tail still cuts and answers, counted as the tail's outcome. - **`omi_conversations_v3_finish_to_visible_seconds{path}`**, histogram, `path` ∈ `tail` / `newer` / `newer_dual`, buckets 5 s – 2 h. - **Finish-to-visible sample (no correlation store).** `request_finish` stamps `v3_finish_requested = {at, path}` in the first write it stores on the response target's source: the tail for `tail` / `newer_dual`, B for `newer`. In the stored-both case the tail's write is planned first (`_window_tail_plan`, no read or write), so B's request is stamped only when the answer names B; otherwise B rides along unstamped and B's own card never samples. Consuming cuts and `already_*` answers write no stamp, so a retried Finish keeps the first. The planner carries the stamp to the derived row that shows the cut (first stamp wins). `settle_processing` observes `now - at` once, at the row's first visible manual-end settlement (the `v3_manual_end_home_counted` transition), after the transaction commits; a stamp older than 2 h, a hidden row, or a re-settlement records nothing. `first_speech_to_visible_seconds` is not reused: it fires at row creation, and a live window's row exists before its Finish. `deploy/cloud_run_gmp_sync.yaml` keeps the histogram. - Pipeline lab (`scenario/ops.py`): at seal, the batch lane writes `has_content` with `server_batch_audio_end`, as production's `note_server_batch_audio` does in one transaction. `finish_after_second_close` now expects the answer to name A's window (`finish_response_names_a_window`) and B to be fast-finished (`b_fast_finished`, the check main fails). - Flag registry, contract paragraph in `listen_pusher_pipeline.mdx`, change note, Firestore query driver for `request_finish`. ## Verification All commands ran from `backend/` in the lane worktree, through `omi-heavy`. Base is origin/main `afab9560db2`. - **Scenario on main:** `finish_after_second_close` gave XFAIL. A was cut, B got no fast finish, reads 236. - **Scenario with the change:** PASSED. The answer names A's window; B fast finish `written`; B on Home. Reads 304, writes 74, no-op writes 12, STT 1, LLM 6. The budget is re-measured. - **Scenario with `"env": {"CONVERSATIONS_V3_FINISH_NEWER_CAPTURE": "off"}`:** same as main, at this head. Target A, `b_fast_finished` fails, 236 reads, 62 writes, 0 STT. - **All 13 committed scenarios:** passed. - **Unit tests:** `tests/unit/test_episodes_finalize_paths.py`, 154 passed; with the Firestore guard set, 1079 passed. - **End-to-end race test** (owners' request): `test_one_finish_cuts_a_at_once_and_consumes_b_once_across_resolution_and_retry`, parametrized by B landing with `speech` or `silence`. It runs entirely on StrictFirestore: 1. B is created through the real `triggers.mark_new`, so it carries the creation stamp. 2. Finish runs: one transaction cuts A and stores B's request; the answer names A's window. 3. B's projection lands (`replace_record`), then the real whole-record completion (`store.complete` → `_v3_finish_update`) runs twice. B's request is consumed once: B ends with `v3_manual_end` for speech, or the request is cleared for silence. 4. The same Finish runs again (same body and window id). It answers A's window with `already_cut` and no writes; A is cut once and B is requested once. With the retry guard removed, `[speech]` fails (the retry answers `capture-b`). `[silence]` still passes, because a mark that resolved empty no longer holds the Finish, so the retry reaches A's tail either way. - **Each new test fails without its own fix.** Mutation runs: - R1, no stored-both path: 12 fail; - R7, `has_finish_content` as the batch speech signal: 4 fail (`created_stamp=True`); - R2, ledger reads not hoisted: 4 fail (StrictFirestore read after write); - R3, stored-both retry guard removed: 3 fail; - R4, a blocked mark answers instead of a tail cut: 5 fail; - R5, a retry decline is a 404: 1 fails; - R6, the older-than-mark condition removed: 1 fails. The previous round's mutations (`has_content` gate, `already_empty` decline, newest-wins, deletion marker) still hold. - **Degraded-targeting telemetry counts once per Finish.** A tie or a full scan records `omi_fallback_total` (`conversation_finalization`, `newer_capture` → `window_tail`, `degraded`). `_newer_capture` only marks a per-attempt flag, reset at the top of the transaction body; `request_finish` records it once after the transaction commits. `test_live_window_finish_records_degraded_targeting_once_across_transaction_retries[tie|full_scan]` aborts the first attempt after the scan and before any write. With the recording back inside the body, both cases fail: "Called 2 times". - **Targeted set:** 43 files, 2597 tests passed: the changed tests, the Firestore guard set, every `test_conversations_v3_*`, `test_reliability_experiment_end_*`, `test_reason_label_enums`, `test_pipeline_lab_*`, `test_batch_pipeline_projection` and `test_server_batch_completion`. - `scripts/check_feature_flag_registry.py` OK. ### Review fixes (panel `review-20261127t015349-a22e`, F1–F5) - **F1** Finish-to-visible sample: `test_live_window_finish_stamps_only_its_response_target[tail|newer|newer_dual]`, `test_retried_live_window_finish_keeps_the_first_stamp[...]`, `test_consuming_cut_keeps_the_stamp_of_the_finish_that_stored_the_request[tail|newer]`, `test_finish_stamp_follows_the_cut_to_its_card_once` (planner, dual card), `test_finish_to_visible_is_observed_once_at_the_first_visible_settlement[...]` (re-settlement does not repeat), `test_finish_to_visible_drops_stale_hidden_and_unstamped_rows[stale|hidden|unknown_path|no_time|unstamped]`, `test_finish_to_visible_dual_card_samples_only_the_response_target`, `test_cloud_run_sync_scrapes_finish_to_visible`. - **F3** decline: `test_live_window_finish_counts_a_declined_newer_capture_and_still_cuts_the_tail[already_empty|batch_unavailable|batch_disabled|recording_ineligible]` and, separately, `test_live_window_finish_without_a_newer_candidate_counts_no_decline[none|older_than_window|silent]`; `test_newer_capture_finish_labels_are_reachable_or_absent`. - **F2/F4** read counts: the three exact read-sequence tests above. - **F5** `test_live_window_finish_cuts_the_tail_without_a_newer_finishable_capture` asserts on the retained `b` that neither `v3_manual_end` nor `v3_manual_end_requested` was written (and, for `none`, that B was not recreated). - Mutations: dropping the decline record fails 4; stamping B's request in the stored-both case fails 1. - Focused files (15), all passed at the earlier merged head (origin/main merged after main moved): `test_episodes_finalize_paths` 178, `test_conversations_v3_fast_finish` 115, `test_conversations_v3_contract` 119, `test_firestore_query_shapes` 644, `test_firestore_runtime_witnesses` 25, `test_conversations_v3_live_passes` 53, `test_conversations_v3_live_rederive` 129, `test_conversations_v3_created_delivery` 59, `test_conversations_v3_engine` 97, `test_conversations_v3_finish_late_predecessor` 33, `test_batch_pipeline_projection` 87, `test_pipeline_lab_scenario` 51, `test_monitoring_telemetry_contract` 58, `test_fleet_deployment` 11, `test_attach_cloud_run_gmp_sidecar` 117. - `python -m testing.pipeline_lab affected` → 15 scenarios, all passed, budgets unchanged (`finish_after_second_close` included). The full backend unit suite is left to CI. ## Lab vs production - **The final conversation shows `manual_end = no` in the lab.** The lab's native-completion stand-in (`batch_projection`) skips the projection transaction, so neither A's window-scoped request nor B's recording-scoped request is ever promoted to `v3_manual_end`. Production promotes them: at admission for a window-targeted single unit, at whole-record ledger completion for a recording-scoped request (`database/batch_pipeline_projection.py`, `whole_record_consumed`), as for the existing #26288 fallback. In the lab, A and B end in one conversation because no cut lands. - **#26344 interaction.** #26344 is merged into this branch (merge `4d2e913c`). Under its chunked fast finish and extended lab STT stand-in, `finish_after_second_close` still meets every check (`b_fast_finished: written`, STT 1 via `fast_finish`), now at 299 reads (was 304). ## Rollback Set `CONVERSATIONS_V3_FINISH_NEWER_CAPTURE=off` on the API service that serves `POST /v1/conversations`. That restores exactly main's Finish without a deploy; cuts and requests already stored stay. Or revert the merge commit. Product invariants affected: none Failure-Class: none 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
SCA-4385 / SCA-4084: a deliberate pendant Finish leaves no row and no card.
DESIGN
On iOS with a pendant, the app shows a processing row after Finish. The row then disappears, with no card. Production
backendhas answered about 1 in 8 Finishes with 404Conversation in progress not foundsince 2026-11-25T18:00Z. Over 6 h,omi_conversations_v3_finish_no_pointer_totalreadowner_not_enabled27,no_live_window6,cut1 andrecording_requested1.owner_not_enabledcovers non-v3 owners and is left alone. The affected owner's pendant recordings are 4–90 s long and seal at speech pauses. None of their rows since 18:34Z carriesv3_manual_endorv3_manual_end_requested.Cause, confirmed in code (origin/main, serving build 6e3204f has the same path):
processInProgressConversationOutcome) sends{"live_conversation_id": <id>}. The id isConversationsV3Provider.live.id, the derived v3 window fromGET /v1/conversations/live. It is never a raw recording id.processing/writing), settle (done), or be hidden while open, andlive.activerejects all three.live_window_by_idandrequest_finishtherefore find nothing finishable, and no other window is live.finish_live_windowreturnsno_live_windowwheneverwindow_idis set, so the request 404s. The recording fallback was unreachable for this body. It would also have refused anyway, because it requires an unclaimed recording and the tail is claimed by the named window.home_hiddenunless it hasmanual_end(visibility.project). Short pendant windows therefore never reach Home.Change. When the named window is not live and no other window is,
request_named_finishruns one transaction:sync_merged_into) or private._recent_finish_sources(at most 8, newest first). If a sealed capture (status == 'completed',recording is True) sealed after the named one, that newer capture is what the person just finished, and it is cut instead. An in-progress successor never supersedes. A speech-pause rotation writes the next capturein_progress, with a laterfinished_at, before it seals A (routers/listen/conversations.py), and at 8a489b4 that successor turned the main case back into a 404. The unnamed fallback's capture count uses the same sealed-only rule, so an in-progress successor no longer makes an empty-body Finishrecording_ambiguous. Example: A seals and WA ends, then B seals 2 min later into WB, which stays hidden under the word floor and never goes live, so the app still names WA. If B is claimed, its one claiming window must list B as its tail. The transaction declines without writing when the newest capture is ineligible, claimed by several windows, not its window's tail (named_superseded), tied (recording_ambiguous), or past a full scan that does not contain the named capture (recording_lookup_capped).omi/phoneListen capture,completed, sealed withinRECENT_FINISH_AGE(5 min), and not private, deleted, discarded, locked, merged, a partial archive or a failed upload. A window tail must carry a claim by its window and no other. A bare capture must be unclaimed and unmarked, as today.completedand nothome_hidden, the transaction answersalready_visiblewith the existing card (completed/done) and writes nothing. Notes and title are not regenerated, and there is no processing row next to the card. The app upserts that answer over the visible card, so the window read also masks instructured,user_titleandstarred, and the answer goes throughprepare_conversation_for_readafter the transaction (the live tile's projection). The returned row therefore carries the card's title, overview, emoji and starring.READ_CAP200) and the account-deletion marker before any write. A live window that appears first still wins._finish_window_tail, extracted unchanged fromrequest_finish). It setsv3_manual_end,v3_pendingandv3_finish_no_pointer_window_id=<window>, or the deferred batch request. The planner then re-derives the locked window withmanual_end, so it is Home-visible and re-noted. A bare capture gets the existing recording-scoped cut (_finish_capture, extracted unchanged fromrequest_recording_finish). Naming a capture resolves two recent captures that the unnamed fallback reports asrecording_ambiguous.{"live_conversation_id": null}is treated exactly like{}.live_conversation_id(ProcessConversationRequest.finish_only_body) may use the existing single recent-capture fallback. That body is the Flutter Finish. A body with any other field (calendar_meeting_context,client_processing, unknown keys) keeps the previous rule. Empty-body behaviour is unchanged.Reads and writes per Finish (R19). Only a v3 Finish whose named window is not live takes this path, and it runs at most two transactions.
already_visibleanswer adds the live tile's read projection of that one window, asGET /v1/conversations/livedoes.Production number.
omi_conversations_v3_finish_no_pointer_total{outcome="named_recording_cut"|"named_recording_requested"}counts recoveries.already_visiblecounts Finishes answered with an existing card.named_not_finishableandnamed_supersededcount the remaining attributable 404s. Expect Finish 404 share for v3 owners (excludingowner_not_enabled) to fall from ~1/8, withno_live_windowreplaced by these labels.Rollout and rollback
Ship on.
CONVERSATIONS_V3_FINISH_NO_POINTER=offon the API service still restores the lookup-miss 404 for the whole no-pointer path. Rollback is a revert. The code path only widens a 404 branch and adds no schema, index or response-shape change. The new labels are pre-initialised. The metric name is already in the GMP keep regex (backend/deploy/cloud_run_gmp_sync.yaml), so no regex change is needed.Done check
The affected person's next pendant Finish leaves
v3_manual_end=True(orv3_manual_end_requested=Truefor a batch-pending capture) on the sealed recording, a Home-visible window withmanual_end, and anamed_recording_cut/named_recording_requestedincrement on the serving revision.Product invariants affected
none
How it was verified
All runs used
omi-heavyonlane/finish-named-sealed:tests/unit/test_episodes_finalize_paths.py: 104 passed. Without the first commit'sfinish.pychange, its 13 new cases fail. On 6dd3c34, the 7 review cases fail: A-then-B, unproven later capture, and completed-visible. On 8a489b4, 4 delta cases fail: the in-progress successor, empty and with speech, on the named and empty-body paths, and the visible card's title, overview and starring.tests/integration/test_conversations_v3_finish_emulator.py(firebase-tools,emulators:exec --only firestore): 15 passed. New cases:recording_ambiguous, no write.test.shwithBACKEND_UNIT_TEST_FILE_LIST: 20 files and 3,705 tests, all passing. It covers batch pipeline live/projection, server batch completion, v3 contract/fast-finish/created-delivery/live-capture/late-predecessor, reliability end_* experiments, client processing, calendar, lifecycle writers (2,012) and Firestore query shapes (636, with therequest_named_finishdriver over a named window and a named capture).New cases:
writing,doneor hidden-live, with a just-sealed tail, givesnamed_recording_cut. The tail getsv3_manual_end,v3_pendingand the window marker,triggers.enqueue_pending(manual_end_id=tail)runs, and a retry answersalready_cutwith no write.named_recording_cutwith the recording-scoped marker.home_hidden=Falsegivesalready_visible(completed/done) with the card's title, overview, emoji andstarred, and no write and no enqueue.already_cut. Unclaimed B answersalready_cutfrom the recording-scoped marker, and so does an unclaimed B that a hidden window claims between the taps (thev3_manual_endearly return). There is no second write or enqueue.{"live_conversation_id": null}cuts like{}.no_live_window), and account deletion pending.named_not_finishable).hintedrefusal case now carries a second body field.Tests
backend/tests/unit/test_episodes_finalize_paths.pybackend/tests/unit/test_firestore_query_shapes.pybackend/tests/unit/test_lifecycle_state_table_writers.pybackend/tests/unit/test_batch_pipeline_projection.pybackend/tests/unit/test_server_batch_completion.pybackend/tests/unit/test_reliability_experiment_end_open_conversation.pybackend/tests/integration/test_conversations_v3_finish_emulator.py(Firebase emulator)UI evidence
UI-Evidence: none -- backend-only change, existing response schema
Failure class (fixes)
Failure-Class: none
🤖 Generated with Claude Code