Skip to content

fix(conversations-v3): rotate long v3 recordings at speech pauses (default off, cohort canary) - #25726

Merged
kodjima33 merged 9 commits into
mainfrom
fix/v3-recording-rotation
Nov 18, 2026
Merged

kodjima33 merged 9 commits into
mainfrom
fix/v3-recording-rotation

Conversation

@kodjima33

@kodjima33 kodjima33 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Conversations v3 is on for TestFlight. A pendant capture is a batch-only recording. It has no transcript until it seals, and it seals only after 120 s of speech quiet (#25633) or at socket close. In a cafe the speech never pauses for 120 s. Nik's recording 4170f9cf ran 19:01:54 to 19:35:31Z (33.6 min). His chat ended 19:09:50Z, and its derived rows appeared at 19:40:52 and 19:43:08Z. Home showed nothing for 31 minutes.

Change (ships OFF)

  • Rotation (routers/listen/conversations.py _v3_rotation_due, _rotate_v3_recording, _seal_rotated, _seal_rotated_recording; utils/stt/speech_clock.py rotation_due). A batch-owned row with recording: true (the v3 marker) seals at the first 1.5 s speech pause once it is CONVERSATIONS_V3_ROTATION_MIN_SECONDS old (default 180), or at CONVERSATIONS_V3_ROTATION_MAX_SECONDS (default 300) without a pause. A row never rotates if it is a legacy row, an onboarding capture, has no speech of its own, has a pending client stop (finalization_reason), is under an episode hold, or is inside the 60 s backoff after a failed rotation. A tick that is already a quiet seal or a producer boundary_at takes the existing path. A failed or absent SpeechClock uses only the cap.

  • Cut order (fixes the custody blocker). This is the order rollover_after_transcript_decode_failure already uses:

    1. Create the successor first. The old row stays in_progress and keeps receiving audio until current_conversation_id switches.
    2. LiveAudioArchive.retarget(old, successor) (utils/other/live_audio_archive.py), under the archive lock. From then on, any frame still addressed to the old id is appended to the successor. This covers a frame the receiver bound before the switch and appended after it.
    3. finish_recording(old) flushes and commits the old row's packs. Its custody is then final.
    4. Stamp v3_rotation_cap_seconds, then run process_conversation(old). The old row is no longer current, so close_batch_archive skips the global close, exactly as in the decode-failure rollover.

    A custody timeout leaves the old row queued and retries it on the next tick (at most 8 queued). After socket close, the old row's armed quiet check and stale recovery own it. A successful seal drops the old producer token, so the 64-token cap is not reached on long sockets.

  • Supersede mode (create_new_in_progress_conversation(rollover=True, supersede=previous_id), database/listen_continuations.py supersede_live_continuation).

    • Phone sockets send client_conversation_id. Without this mode, the create first resolved the origin's live_continuation pointer, which named the still-open current row, and resumed that same row. So a long recording rotated at most once.
    • In supersede mode the create skips both continuation resumes.
    • The pointer moves only after the successor is claimed, armed and is current_conversation_id, in one transaction. A failed create therefore never leaves the pointer on a dead empty row.
    • It moves only when the pointer names the retired row, one of this socket's own recordings, or nothing. Otherwise other_owner is counted and logged, and another generation's pointer is never taken.
    • A reconnect resumes the successor.
  • Successor failure. If the create raises, or returns without switching, the current recording is kept. recording_session_id, batch_record_capture, recording_session_ids_by_conversation and the Redis in-progress id are restored, and rotation backs off 60 s (ROTATION_RETRY_SECONDS). A WebSocketException (ownership changed, or the 64-token cap) is re-raised after the restore, so the socket closes as it would on any other create.

  • No rotation on reconnect-protocol rows. A row carrying listen_batch_producer never rotates. Its producer token would fence both the seal retries and stale recovery of an orphan. The flag is unset in prod, so this is inert today.

  • Seal retries. A retired recording stays in _unsealed_rotations until process_conversation returns True.

    • Refused seals retry after 15, 30, 60 and 120 s.
    • Teardown (routers/listen/runtime.py, before the current row is handled) runs drain_rotations for one last attempt.
    • On hand-off, the socket drops the producer token, so the cap stays reachable only by live rows.
    • The row is then left in_progress for LiveConversationController.recover_stale_in_progress (routers/listen/conversations.py). That runs in process_pending on the owner's next listen connection, for rows quiet for an hour, and seals through process_conversation.
    • Correction to the previous round: the quiet check armed at creation does not recover a v3 recording. recovery_admission_refusal returns terminal_no_derived, because triggers.mark_new stamps terminal_no_derived_effects on every v3 recording. This holds for any crashed v3 socket today, not only for rotation.
    • Counter: omi_listen_v3_rotation_total{outcome=rotated|same_row|create_failed|seal_failed|seal_retry|handed_off|other_owner} through the reason-enum core (RecordingRotationOutcome, family recording_rotation).
  • Builder (database/conversations_v3.py _mark_successor_pending). It applies only when the latest spoken recording carries v3_rotation_cap_seconds, which only rotation writes. In that case it keeps the stretch open while a later recording is in progress under that cap + 15 s, or processing for under 15 min. With rotation off, no row has the stamp, and the builder behaves exactly as on main. The successor query is .select() over 8 metadata fields, limit 8, single-field started_at index. It is registered in the query-shape drivers.

  • Switches.

    • CONVERSATIONS_V3_RECORDING_ROTATION: off (default), cohort (members of the v3-recording-rotation rollout cohort) or on.
    • The cohort lives in the rollout_cohorts collection. No uid goes in deploy source.
    • All three envs are in deploy/runtime_env/_base.yaml (composed runtime_env.yaml) and both listen chart values files, as off/180/300. They are also in config/feature-flags.yaml, the rendered registry and deployment-setting-classification.json.
    • Changing any env value rolls backend-listen. Membership changes do not roll (60 s cache).

Canary for one owner

  1. In backend/deploy/runtime_env/_base.yaml (gke backend-listen env) and backend/charts/backend-listen/prod_omi_backend_listen_values.yaml, set CONVERSATIONS_V3_RECORDING_ROTATION to cohort. Recompose with python3 backend/deploy/compose_runtime_env.py, merge, then roll listen with gcp_backend_listen_helm.yml (environment=prod, branch=main, expected_sha, mode=deploy, image_tag). With an empty cohort this is still off for everyone.
  2. Write the uid to a private file (0600), then run:
    GCP_AGENT_TIER=prod-operator backend/.venv/bin/python backend/scripts/rollout_cohort.py --uid-file <file> --cohort v3-recording-rotation --project based-hardware --environment prod --add --apply
    It takes effect within 60 s. To undo, use --remove, or set the env back to off.

The image must contain this PR first: gcp_backend.yml mode=build-only, then the listen helm deploy. The builder change is inert until rotation stamps a row, so its deploy order does not matter.

Checks

  1. Custody at the cut. The first version of this PR was wrong. It sealed the old row while the socket kept binding frames to it, and server_batch_audio_closed is not set while the socket is active (batch_close.py:46). With the reconnect flag off, late frames extended a processing row's window. With it on, note_server_batch_audio refused them and poisoned uncommitted. The new order makes it impossible for a frame to join the old row once its seal starts.
    • Proof: tests/unit/test_listen_v3_rotation_custody.py, parametrized with LISTEN_BATCH_RECONNECT_ENABLED off and on.
    • It uses the real LiveAudioArchive (durable outbox on the hermetic remote bucket), the real note_server_batch_audio / _received on StrictFirestore, and the real _rotate_v3_recording → finish_recording → process_conversation → close_batch_archive.
    • 120 frames are produced concurrently. Each is bound before a yield, like the receiver. One extra frame is bound to the old id and appended after the seal.
    • Assertions: every frame is committed exactly once; each frame lies inside its own row's window; the sealed window is identical before and after; old frames all precede successor frames; uncommitted is empty; the archive did not fail; the old producer token is dropped.
    • Mutation check: with the retarget line removed, the reconnect-off case fails with the sealed window growing from (1000.00, 1000.46) to (1000.00, 1001.21), and the reconnect-on case never seals.
    • The receiver's ownership bookkeeping is not retargeted. Its sample ranges (_note_accepted_frame) only place live-STT transcripts, which batch-only sockets do not run. The custody ACK checkpoints per-channel frame sequence numbers, not conversation ids.
    • The test proves the ACK publishes once over retargeted frames, with nothing left pending. It also bounds the skew: the successor's started_at equals its server_batch_audio_start, which is the frame right after the sealed window, within one 10 ms frame of it.
    • Not real in this test: create_new_in_progress_conversation is a binding-equivalent stub. The real create path is covered by the continuation test below. It creates the server-batch row with yields that stand in for Firestore round trips, then switches current_conversation_id. schedule_finalization is stubbed to record the window and set processing. The full create path needs the recording-session, Redis and calendar stack and was not exercised.
    • Words: a word that straddles the cut lands whole in one recording's audio, but each recording is transcribed separately, so a word cut by the 300 s cap can be split across two transcripts. Cuts at a 1.5 s pause avoid that.
      1b. Rotation on a phone socket, through the real create path (tests/unit/test_listen_v3_rotation_continuation.py). This uses the repo's CaptureHarness: the real create_new_in_progress_conversation, real resolve_live_continuation on StrictFirestore, and client_conversation_id='original'.
    • The old call (no supersede) returns the same row, which reproduces the bug.
    • Four consecutive rotations give 5 distinct recording ids. The pointer names each new successor in turn, every retired recording is sealed and stamped, nothing is deleted, and nothing is left unsealed.
    • A reconnect afterwards resumes the last successor.
    • Mutation check: with supersede removed, the test fails with sealed == [].
    • supersede_live_continuation refuses a pointer owned by another generation and returns absent for a missing origin.
      1c. What the phone does. The app parses conversation_session as UnknownEvent and ignores it (app/lib/backend/schema/message_event.dart).
    • A rotation seal sends memory_processing_started for the retired recording. That is the same event and the same process_conversation → schedule_finalization path a quiet seal uses today, so the quiet seal is the precedent.
    • On that event the client keeps streaming on the same socket. CaptureController.onMessageEventReceived (app/lib/services/capture/capture_controller.dart:4089) stamps the session's WALs with the recording id (_finalizeAndStampSession) and starts a new session.
    • v3 Home re-reads the list and the live conversation on a capture event, at most every 10 s, instead of adding the recording as a row (app/lib/pages/conversations/conversations_page.dart:411).
    • Difference from a quiet seal: frequency. A batch recording's memory_created arrives only after GPU transcription, which takes more than 30 s. So the 30 s fallback runs _confirmSessionWalsRetained(..., failClosedReason: 'missing_conversation_event') and auto-syncs the retained WAL for every rotated recording, as it already does after each quiet seal.
    • Consequence: about one WAL upload per 3-5 min instead of one per quiet-ended recording. These sync pieces then hit the containment issue in check 4.
    • I read the code. I did not run the 1.0.593 client.
  2. Stitching. outline.stretches splits only on a 5 min gap or a manual cut, so recording boundaries do not split a conversation. planner.windows/build copy lines in order across recordings. The finish rule is what could false-split: the commit clears v3_pending on an untranscribed live successor. _mark_successor_pending handles that for rotation-sealed rows. Tests: test_untranscribed_successor_keeps_the_stretch_open (7 cases), test_a_recording_rotation_did_not_seal_keeps_the_five_minute_rule and test_rotated_recordings_stitch_into_one_stretch_in_order.
  3. Load, for a 1 h continuous capture. Before: 1 recording and 1 batch unit. After: 12 recordings (300 s cap) to about 20 (180 s + pause). Audio seconds are unchanged. Per recording, there is one more of each: successor create (recording-session open, producer claim, quiet-check arm), finalization request and pusher close, intake claim, admission authorize, batch job and lease docs, merge head, projection, cap stamp. v3 reconcile stays a named task per owner-minute. Unfinished stretches make no LLM call. The builder adds one ≤8-doc metadata query per pass. Default off means no load change until a canary.
  4. Sync bridges. The reviewer is right. batch_target_contains (utils/sync/live_overlap.py:105-131) refuses a piece that starts before a target, or ends after a sealed one. Prod sample, Nik, 2026-11-18, metadata only:
    • 15 of 17 listed live recordings had overlapping WAL pieces.
    • Of the 18 pieces, 13 sat inside one recording (10 merged, 3 pending).
    • 5 already span a recording boundary today and stay standalone legacy-layer rows. Examples: e87bfed2 18:57→19:33 starts before 4170f9cf, and 09be1e39 covers three recordings.
    • With 3-5 min recordings, pieces over a few minutes would stop merging. That is 3 of today's 10 merged pieces (5.5, 5.0 and 30.3 min, including 80484b85 against 4170f9cf).
    • What the user would see: a legacy-layer sync card for the same speech next to the v3 derived conversation, once its settling hold ends. The v3 "same text ±2 s" dedupe does not catch two independent transcriptions.
    • Not fixed here, and a blocker before on. The cohort canary should watch for these duplicates. Fleet-wide frequency was not measured: no collection-group index exists to query bridges across owners.
  5. Legacy untouched. recording is True plus server_batch_owned is required. Tests: test_legacy_row_never_rotates and test_off_is_the_old_lifecycle (unset, off and empty-cohort all keep the main lifecycle, including the quiet seal). The builder gate is the row stamp.
  6. Calendar. A meeting does not block v3 rotation (test_a_calendar_meeting_does_not_block_v3_rotation). v3 conversations come from transcript windows, and create_new_in_progress_conversation re-attaches the active meeting to the successor.
  7. Speaker labels. Batch diarization labels are per unit, so SPEAKER_0 in recording N is not SPEAKER_0 in N+1. The owner (is_user) and named people (person_id) are resolved per recording from embeddings (utils/conversations/speaker_resolution.py), so they stay consistent. recording_carry copies manual speaker assignments into the successor. What breaks: unnamed voices get different S-numbers every 3-5 min inside one derived conversation, both in the copied transcript and in the outline input. The outline prompt already treats S-numbers as unreliable. Shorter recordings also give speaker resolution less audio per voice. That may lower wearer recognition, which v3 needs before it hides background talk. Not measured.

Latency, from "conversation ends" to "derived row visible"

  • Before (continuous background speech): unbounded, until 120 s of quiet or socket close, plus batch transcription. Nik's case was 31 min, with about 5 min of transcription for a 33.6 min recording.
  • After, for a canary owner: the first derived in-progress row appears 3-5 min after speech starts, plus transcription of a 3-5 min recording. When the conversation ends, the open recording seals within at most 180 s (usually at the next pause). Notes follow at last speech + 5 min, by the unchanged planner rule. If cafe noise is itself transcribed as lines, the stretch stays open. It is visible live, but auto-notes wait. A Home row within about 1 minute is not delivered here.

Related

David's lane: #25714 and #25659 touch the v3 store and service, not this load() tail or lifecycle_loop. #25633 introduced SpeechClock. routers/conversations.py get_live_conversation is not touched.

Verification

  • Unit: 4118 passed, 2 skipped. Locally, test_cloud_run_metrics_egress_workflow fails on macOS bash 3.2 (empty array under set -u), and test_rollout_cohorts flakes under xdist but passes alone. Neither touches these files. Earlier round: 3113 passed and 1 skipped across every conversations_v3*, listen_*, archive, outbox, desktop-batch, cohort, runtime-env, flag and query-shape file, including the new custody and lifecycle cases.
  • Lifecycle cases cover: process returns False, successor create fails, successor resumes the same row, user_stop, quiet tick, episode hold, producer boundary_at, exact threshold boundaries, env tunables, cohort membership, and off equal to main.
  • backend/scripts/typecheck.sh: 0 errors. scripts/pr-preflight --pr-body-file: green.
  • New tests:
    • seal retry backoff and hand-off;
    • a raising seal that is retried, and an admitted seal that drops its token;
    • teardown drain;
    • failed-create residue restore;
    • retarget chains A→B→C and the 64-entry eviction;
    • an orphan left by a crash between create and seal: the real quiet.arm / quiet.run refuse it (test_a_rotation_orphan_is_left_for_listen_stale_recovery_not_the_quiet_check), and recover_stale_in_progress seals it on a later connection (test_a_rotation_orphan_is_sealed_by_stale_recovery_on_a_later_connection);
    • runtime teardown awaits drain_rotations;
    • the reviewer's probe as a test: a failed _persist_policy_and_arm_quiet_check leaves the pointer on the old row, and the retry moves it;
    • own_ids acceptance;
    • a WebSocketException closes the socket;
    • the Redis restore;
    • token pop at hand-off;
    • no rotation on reconnect-protocol rows.
  • Not verified: no device capture and no dev or prod run. The custody test stubs the create, while the continuation test runs the real create without a real archive.

Line-Count-Exception: backend/routers/listen/runtime.py | 1576 -> 1578 | teardown drains retired v3 recordings before it handles the current row

Product invariants affected

  • INV-MEM-4

Cited because backend/deploy/runtime_env.yaml changed. The change only adds three backend-listen env entries; memory intake and promotion are unchanged.

Failure class (fixes)

Failure-Class: FC-transport-liveness-read-as-speech-activity

🤖 Generated with Claude Code

@kodjima33 kodjima33 changed the title fix(conversations-v3): seal long v3 recordings at speech pauses so conversations appear during a long capture fix(conversations-v3): rotate long v3 recordings at speech pauses (default off, cohort canary) Nov 18, 2026
@kodjima33
kodjima33 merged commit ae68d31 into main Nov 18, 2026
77 of 79 checks passed
@kodjima33
kodjima33 deleted the fix/v3-recording-rotation branch November 18, 2026 22:57
kodjima33 added a commit that referenced this pull request Nov 18, 2026
## Problem

Follow-up to #25726 (merged as `ae68d3176d`, rotation off). The round-4
review found these failure paths in `_rotate_v3_recording` and the
supersede step. They have to land before the one-owner canary.

## Change

1. **Pointer move failure** (`routers/listen/conversations.py`,
supersede block in `create_new_in_progress_conversation`). The
`supersede_live_continuation` call runs after the switch. It is now
wrapped in try/except: a failure is logged and counted as
`pointer_failed`, and the create always continues to its tail (capture
timeline, admission attach, `_refresh_speakers`,
`send_conversation_session`). Test:
`test_a_failed_pointer_move_still_finishes_the_successor_and_counts_it`,
using the real create path in `CaptureHarness`. The successor is fully
bound, the old row is sealed, the phone gets the session event, and the
Redis id names the successor.
2. **Redis restore can't mask the error.** The restore moved into
`_clear_failed_successor`, where any failure is caught and logged. A
`WebSocketException` from the create is still re-raised. Test:
`test_a_failing_redis_restore_never_masks_ownership_loss`.
3. **Empty successor after a bound-then-failed create.**
- `_clear_failed_successor` first publishes the successor's close
barrier (`close_server_batch_audio`, with its producer token if it has
one), then calls `delete_empty_recording_conversation(...,
allow_empty_server_batch=True)` and checks the result.
- The barrier is required because the delete only accepts a closed,
never-received batch row (`database/recording_sessions.py:294-310`).
- A row the delete keeps (it has audio) is counted as `successor_kept`
and logged. It is `in_progress` and not current, so stale recovery seals
or deletes it.
- Tests use the real `tombstone_and_delete_empty_conversation` on
`_FakeFirestore`:
-
`test_a_failed_create_publishes_the_barrier_then_deletes_its_empty_successor`:
the unclosed owned successor is deleted. With the barrier call removed,
this test fails, because the delete is a no-op.
- `test_a_failed_create_keeps_a_successor_that_has_audio`: the successor
is kept when it has `has_content`, `server_batch_audio_received` or
`server_batch_audio_start/end`.
   - The earlier test that monkeypatched the delete is removed.
- **Residual label window:** between the start of the create and the
restore, `host.recording_session_id` already names the successor's
session while frames still go to the old row. That label feeds telemetry
(`receiver.py:886`) and the recording-session lease renewal, never audio
binding: the archive binds by `current_conversation_id`, which never
names a failed successor.
- `test_frames_during_a_failed_create_never_bind_to_its_successor` runs
40 frames through a real `LiveAudioArchive` while the create fails, with
the session label observed as `session-2`. Every frame lands in the old
row's window, the successor is deleted, and nothing stays uncommitted.
- After an ownership loss (`WebSocketException`), the Redis restore is
skipped, because another socket owns the recording. Test:
`test_ownership_loss_skips_the_redis_restore`.
4. **`skipped_producer` outcome.** It is counted once per row (the set
keeps the last 64 row ids; `test_producer_skips_stay_bounded`) when the
reconnect producer protocol blocks rotation, and only for owners
rotation admits. `pointer_failed`, `skipped_producer` and
`successor_kept` are added to `RecordingRotationOutcome`. Test:
`test_a_reconnect_protocol_skip_is_counted_once_per_row`.

Rotation stays off in every environment
(`CONVERSATIONS_V3_RECORDING_ROTATION=off`). No flag, chart or runtime
env value changes.

## Before widening (design only, not in this PR)

A crashed v3 socket leaves its recording `in_progress`, whether or not
rotation ran. Only listen stale recovery seals it:
`recover_stale_in_progress` (`routers/listen/conversations.py`), on the
owner's next connection, after an hour of quiet. The durable quiet check
armed at creation refuses it. In `recovery_admission_refusal`
(`database/conversation_finalization_jobs.py:380`), `if
conversation.get(TERMINAL_NO_DERIVED_EFFECTS_FIELD): return
'terminal_no_derived'` matches every v3 recording, because
`utils/conversations/v3/triggers.py:61` (`mark_new`) stamps
`terminal_no_derived_effects=True` at creation. The quiet check reaches
it at `database/conversation_quiet_checks.py:212`.

**Smallest fix:** exempt only v3 recordings with server-batch audio from
that refusal:

```python
if conversation.get(TERMINAL_NO_DERIVED_EFFECTS_FIELD) and not (
    conversation.get('recording') is True and server_batch.has_audio(conversation)
):
    return 'terminal_no_derived'
```

For a recording the marker means it never takes derived effects. It does
not mean the row is already finalized. Processing still goes through
`recording_short_path` (`utils/conversations/v3/service.py:54`): no
model, apps, memories or webhooks, then `lifecycle.complete` plus the v3
builder trigger.

The refusal is shared with `database/stuck_backfill.py:59`, so the fix
needs one test per caller:
- the quiet check admits a v3 recording with audio, after its lease
expires;
- the admitted job completes through `recording_short_path` with no
derived effects;
- stuck backfill and legacy terminal rows are unchanged.

A separate sweeper would duplicate the quiet check's lease and fence
logic, so I'd not build one. Ownership: lane/conversations-v3. Until
this lands, widening past a canary leaves any crash-orphaned v3
recording invisible until the owner reconnects.

## Verification

- Unit: `test_listen_batch_speech_quiet.py`,
`test_listen_v3_rotation_custody.py`,
`test_listen_v3_rotation_continuation.py` and
`test_reason_label_enums.py` all pass. Listen, v3, quiet-finalization,
desktop-batch, recording-session and query-shape suites: 2572 passed, 1
skipped.
- `backend/scripts/typecheck.sh`: 0 errors.
- `scripts/pr-preflight --pr-body-file`.
- No device or prod run. Rotation is off.

Line-Count-Exception: backend/routers/listen/conversations.py | 1458 ->
1519 | rotation failure handling (pointer-move guard, failed-successor
cleanup, producer-skip count) stays beside the create path it guards

## Product invariants affected

none

## Failure class (fixes)

Failure-Class: FC-transport-liveness-read-as-speech-activity

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Git-on-my-level added a commit that referenced this pull request Nov 21, 2026
…behaviour for the listen roll (#25954)

## Summary

backend-listen still serves `backend:44d0a4f` (18 Nov). On current main,
the listen values would switch three things on at the next listen roll
(SCA-3516). Release's installed preflight refuses all three. This PR
pins each one **by effect**, so the roll preserves today's behaviour.
Shipping ruled at 2026-11-21 13:25Z on SCA-3516 that no activation rides
the listen roll.

| Key | What 44d0a4f does today | Main without this PR | Pinned | Why
the pin matches |
| --- | --- | --- | --- | --- |
| `BATCH_ACCOUNT_PRIVACY_WRITER_ENABLED` | Nothing. The account privacy
writer (`database/batch_account_authority.py`, kill switch in
`config/policy/kill_switches.py`) is not in 44d0a4f. | `true` (kill
switch default on) | `false` | `false` keeps the legacy writer routing
that 44d0a4f has. A first activation on listen is a custody decision
(David). |
| `BATCH_PIPELINE_PACKING_SAMPLE_RATE` | Nothing.
`config/batch_pipeline_packing.py` is not in 44d0a4f. | `0.001` | `0` |
`sample_rate()` accepts 0, and `packing_counterfactual` gates on
`bool(sample_rate())`, so 0 means no sampling. |
| `UNLIMITED_V2_BACKFILL_HOURS_CAP_ENABLED` | The cap exists in 44d0a4f
and its chart renders `"false"` (live: false). | `true` (#25677) |
`false` | Same as live. Listen also admits sync backfill uploads
(`/v2/sync-local-files`), so listen admission stays **uncapped exactly
as today**; Cloud Run sync stays capped. Capping listen is the follow-up
below. |

Rotation: `CONVERSATIONS_V3_RECORDING_ROTATION` already renders `off`,
with `CONVERSATIONS_V3_ROTATION_MIN/MAX_SECONDS` at 180/300.
`rotation_seconds()` reads those two values only at
`routers/listen/conversations.py:1273` and `:1412`, and both calls sit
behind `recording_rotation_enabled()`. With rotation off, nothing reads
them. 44d0a4f does not contain #25726.

Changed: prod overlay `backend/deploy/runtime_env/prod.overlay.yaml`
(gke/backend-listen), the regenerated `backend/deploy/runtime_env.yaml`,
the listen prod chart values, the regenerated flag registry doc, the
listen contract doc line, a change note under
`backend/docs/listen_pusher_pipeline/changes/`, and the backfill-cap
validator test. The test now carries a dated exception for prod
backend-listen and asserts all three pins on both the composed manifest
and the listen chart. The floor is kept at >= 5 surfaces.

## Follow-up after the listen roll
This is a cost-control item: listen backfill admission is uncapped today
and stays so until then. Turn the backfill cap on for listen as its own
config change: David's 2026-11-18 support-packet decision 13 intends it
on for every prod surface. Then remove the test exception. The privacy
writer on listen stays off until David decides it.

## Verification
- `bash test.sh` changed-file selection under `bin/omi-heavy`: passed
(rc 0). `tests/unit/test_backend_runtime_env_validator.py`: 300 passed.
- Release's installed preflight render is the acceptance check at the
exact head.

## Product invariants affected
- INV-MEM-4: the change touches a locked deploy path (runtime manifest)
but changes no memory intake or promotion behaviour. Each value is
pinned to what the serving listen image already does, and no code path
changes.

## Rollback
Revert this PR. The listen roll itself rolls back with `mode=rollback`
to the prior Helm revision.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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