Skip to content

fix(sync): 60-day backfill lookback and Unlimited 24 h/day STT cap deferred at upload - #25677

Merged
Git-on-my-level merged 6 commits into
mainfrom
lane/sync-backfill-60d
Nov 18, 2026
Merged

Git-on-my-level merged 6 commits into
mainfrom
lane/sync-backfill-60d

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Two changes ship together, by David's decision (2026-11-18 support-packet decisions 12-13): the 60-day sync backfill lookback, and the Unlimited 24 h/day backfill STT cap, enforced only at upload.

Raise the production offline-sync backfill lookback SYNC_BACKFILL_MAX_AGE_SECONDS from 30 days (2592000) to 60 days (5184000) on backend-sync and backend-sync-backfill. Audio that has waited 30 to 60 days to sync will then be admitted and transcribed, where today it is refused with 422 backfill_lookback_exceeded ("Too old to sync" on the phone).

Customers with large pendant or phone backlogs report recordings marked "Too old to sync". The server checks the lookback once, when the upload is admitted (backend/routers/sync.py 422, backend/utils/sync/lanes.py classify_sync_lane -> lookback_exceeded). Server-side ordering (SYNC_BACKFILL_ORDER) only applies after admission, so it is not what ages audio out; backend-sync-backfill runs SYNC_BACKFILL_ORDER_PERCENT=0 in prod anyway. The app has uploaded history oldest-first since 143d09f (2026-10-26). Recordings cross the 30-day line for two reasons:

  • Older app builds still drain newest-first, so interrupted runs never reach their oldest audio.
  • Backlogs too large to drain within 30 days, because the phone is offline or rarely foregrounded, or because of rate-limit breaks.

The refusal is permanent for that recording. The phone keeps the bytes, but the attempt is terminal.

Changes

  • backend/deploy/runtime_env/prod.overlay.yaml: both prod entries go to '5184000', with a comment giving the rollback. The _base.yaml / dev value and the code default (30 days) are unchanged.
  • backend/deploy/runtime_env.yaml: regenerated with compose_runtime_env.py (--check clean).
  • backend/tests/unit/test_backend_runtime_env_validator.py: a new test pins prod at 60 days. It also asserts that no prod surface (Cloud Run services and jobs, GKE) seeds a nonzero BATCH_PIPELINE_BACKLOG_RELEASE_REACH_SECONDS below the lookback. The backlog-release reach also measures capture age, so a reach shorter than the lookback would hold back audio that admission accepted. No prod surface sets it today (0 = unlimited). This guards only the env seed: the effective reach lives on the backlog-release Firestore gate row, whose code floor is MIN_REACH_SECONDS = 30 days (backend/config/batch_pipeline_backlog_release.py). An operator who opens the gate with a nonzero reach should use at least 60 days.
  • backend/docs/runbooks/sync-two-lane.md: notes the prod value and the reason for it.
  • backend/routers/sync.py, backend/utils/backfill_hours_cap.py (defers_upload): the upload-time day-cap defer.
  • backend/utils/sync/pipeline.py, backend/utils/sync/cap_hold.py, backend/utils/batch_pipeline/admission.py, backend/utils/batch_pipeline/allowance_hold.py: the cap's segment-time and batch-time enforcement is removed.
  • Prod overlay and backend/charts/backend-listen/prod_omi_backend_listen_values.yaml: the cap is on at 24 h.
  • config/feature-flags.yaml, the cap runbook and listen_pusher_pipeline.mdx: updated to the upload-only contract.

Unlimited backfill day cap, enforced at upload

Prod turns on UNLIMITED_V2_BACKFILL_HOURS_CAP_ENABLED=true, UNLIMITED_V2_BACKFILL_HOURS_CAP_HOURS=24 on every surface that declares it: Cloud Run backend, backend-sync, backend-sync-backfill, backend-integration, and GKE backend-listen (runtime env plus the listen prod chart). Dev stays off.

What it does.

  • Who: only the unlimited_v2 plan. Free, Plus and the deprecated paid tiers are unchanged. BYOK, marketplace-reviewer and release-probe allowances are exempt.
  • What it counts: transcription_seconds already on users/{uid}/hourly_usage for the current UTC day.
  • When it applies: only to backfill-lane uploads, not exact custody repairs. Live listen and fresh capture are never touched.
  • What happens at the cap: routers/sync.py answers 503 with X-Omi-Rate-Limit-Reason: backfill_capacity and Retry-After set to the next UTC midnight. This happens before anything is archived or a job exists. The app already treats that as paced admission (isPacedSyncAdmissionReasonCode): the recording stays pending on the phone and retries without spending a WAL retry.
  • Overshoot: the check sees only already-metered seconds, so one admitted upload can carry a day past 24 h by at most its own length.
  • Failure handling: an unreadable plan or meter admits the upload.

No server holds. The cap's previous enforcement points are removed:

  • Sync segments: the backfill_cap_active() call in process_segment is gone. It parked admitted audio in stt_cap_holds, and prod has no automatic release for those holds (STT_CAP_DISPATCH_LANES=live, empty cohort).
  • Batch units: the cap is gone from batch_pipeline/admission.py, where it parked units in batch staging under its 60-day delete. The allowance-hold generation returns to the monthly reset; the daily reset existed only for that cap.
  • Hold receipts: these no longer ask the cap for their reason label.

The upload check is now the cap's only bound.

Interaction with the lookback. Deferred audio waits on the phone and keeps ageing. At 24 h/day, a backlog drains before reaching the 60-day window unless it exceeds roughly (60 days minus its current age) x 24 hours of audio.

Cost basis (decision record): Soniox $0.075 per audio-hour (KB parakeet-primary, 2026-09-21), and fleet LLM cost per hour exceeds STT cost per hour (KB hourly-cost-current, 2026-11-18T15:15Z). There is no per-conversation LLM unit cost on record. So the cap bounds STT at about 24 h per Unlimited user per day. Audio aged 30 to 60 days gets full processing in the interim, with LLM uncapped. A historical processing tier (transcript and title now, summary on first open) is being scoped separately as a backend plus mobile pair.

Safety checks

  • Staging lifecycle. The 60-day Delete on the batch staging bucket (storage-lifecycle/retention_contract.json) and the 51-day omi-batch-staged-input-age warning count from object creation and audio_staged_at, which is upload time, not capture time. Audio captured 59 days ago gets a new staging object at upload, with the full 60 days ahead of it. There is no conflict, so 60 days is safe. A smaller value such as 45 days is not needed.
  • syncing-local and omi-private-cloud-sync chunks/ have no age Delete.
  • MIN_REACH_SECONDS (30 days) in config/batch_pipeline_backlog_release.py is a floor and stays valid. The new test guards the relationship in prod config.

Limits of what this recovers

The app persists a 422 as the terminal WalStatus.outsideRecoveryWindow, and it never retries that status (app/lib/services/wals/local_wal_sync.dart _retireOutsideRecoveryWindow, too_old_recording_help.dart). Recordings already marked "Too old to sync" stay terminal on the phone after this change. It recovers audio that is still pending (miss) and 30 to 60 days old, and it stops new retirements in that age band. Re-arming already-retired rows that fall inside the new window needs a separate app change.

Coupling with #25604 (orphan audio reclaim): decided

This PR deletes nothing, but it changes the premise of a deletion ruling.

  • The phone's stranded-orphan reclaim (fix(custody): reclaim stranded orphan audio older than 45 days #25604) deletes unreferenced audio whose capture time and mtime are both more than 45 days old (app/lib/services/wals/orphan_audio_classifier.dart, ageUs = 45 * 86400 * 1000000).
  • David's 2026-11-17 orphan ruling authorized that deletion, and product/invariants/pendant-audio-retention.md ("Explicit exception: stranded orphan audio older than 45 days") encodes it. The ruling rests on the premise that "the server refuses >30-day uploads".
  • Automatic orphan recovery only reaches 28 days (orphanRecoveryWindowSeconds = 28 * 86400; app/lib/services/wals/CUSTODY.md "within 28 days, leaving two days inside the server's 30-day admission window").

With a 60-day window, orphans 45 to 60 days old become admissible but are still deleted, and orphans 28 to 60 days old are admissible but never auto-recovered.

David's decision (2026-11-18): no ramp hold. An app follow-up raises the reclaim age above the lookback plus margin (more than 67 days) and orphan auto-recovery to about 58 days, replacing the 2026-11-17 ruling's 30-day premise.

App copy follow-up

syncTooOldExplanation ("This recording is over 30 days old, so Omi can't transcribe it…", app/lib/l10n/app_en.arb and every locale) becomes wrong in prod once this ships. The follow-up should drop the number, for example "older than Omi's recovery window", rather than hard-code 60.

Rollout and rollback

Both are config values that take effect on the next config train after merge; no new flag.

  • Lookback rollback: set the two prod overlay entries back to '2592000'.
  • Cap rollback: set UNLIMITED_V2_BACKFILL_HOURS_CAP_ENABLED back to 'false' in the prod overlay and the listen prod chart.

Either rollback is one regenerate and one config train. With the cap off, upload admission behaves exactly as before. Segments and batch units no longer consult the cap in either state.

Failure-Class: FC-offline-drain-newest-first-starves-recovery-deadline

Line-Count-Exception: backend/routers/sync.py | 4134 -> 4164 | the day-cap defer must answer at upload admission, before any audio is consumed, which only this route can do

Product invariants affected

  • INV-MEM-4: matched only because backend/deploy/runtime_env.yaml is a watched path. This change does not touch memory intake or promotion.

Test plan

  • New tests/unit/test_sync_backfill_day_cap_upload.py, written first and failing before the change:
    • An over-cap Unlimited backfill upload (45 days old, prod 60-day window) gets 503 backfill_capacity with Retry-After to the next UTC day, and nothing is archived and no job is created.
    • An under-cap upload gets 202.
    • Other plans and BYOK uploads are never deferred.
    • With the cap off, the plan and meter are never read.
    • Fresh-lane uploads and repairs never consult the cap.
    • process_segment and batch admission never consult the cap (no hold on sync or batch).
  • Runtime-env tests pin prod at 60 days and the cap on at 24 h on every declaring surface (dev off). The backlog-release reach guard covers Cloud Run services and jobs and GKE.
  • test_backfill_hours_cap.py and test_batch_allowance_holds.py are updated to the new contract.
  • compose_runtime_env.py --check
  • scripts/run-unit-ci.sh --changed-files via bin/omi-heavy
  • scripts/pr-preflight --all --pr-body-file <this body>

🤖 Generated with Claude Code

Git-on-my-level and others added 3 commits November 18, 2026 16:46
Prod refuses offline-sync uploads older than SYNC_BACKFILL_MAX_AGE_SECONDS
with 422 backfill_lookback_exceeded, which the app persists as a terminal
"Too old to sync" state. Under newest-first draining, the oldest audio of a
heavy backlog is exactly what ages past 30 days. Raise prod (backend-sync and
backend-sync-backfill) to 5184000 seconds and pin it, plus a guard that no
prod backlog-release reach undercuts the admission window.

Rollback: set the two prod overlay entries back to '2592000'.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lookback is checked only at upload admission; server ordering applies
after it and the app drains oldest-first since 143d09f. Restate the cause
(older app builds, backlogs that cannot drain within 30 days) in the overlay,
runbook and test. Extend the reach guard to Cloud Run jobs and GKE.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level and others added 3 commits November 18, 2026 22:33
An unlimited_v2 backfill upload over the UTC-day transcription cap now gets
the retryable 503 backfill_capacity with Retry-After to the next UTC day
before any audio is consumed; the phone keeps it and retries. The cap no
longer refuses at sync-segment or batch-unit time, where it parked audio in
holds that no prod recovery path releases, and the allowance-hold generation
returns to its monthly reset. Prod turns the cap on at 24 h on every surface
that declares it; dev stays off.

Rollback: UNLIMITED_V2_BACKFILL_HOURS_CAP_ENABLED='false' in one config train.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 18, 2026
…e-drain class (#25689)

## What changed and why

Registry-only prose update to
`FC-offline-drain-newest-first-starves-recovery-deadline`: its
violated-contract text says the server lookback is 30 days. Production
is 60 days after #25677 (dev and the code default stay 30). Split out of
#25687 because the failure-class protocol forbids registry edits in an
instance-fix PR.

No status, family, scope or canonical-prevention change.

## Product invariants affected

none

## How it was verified

`scripts/pr-preflight --pr-body-file` on this body. JSON-only change.

## Tests

No test change: registry prose only.

## UI evidence

UI-Evidence: none -- registry text only

## Failure class (fixes)

Failure-Class: none

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/25689?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/25689?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F25689&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
@Git-on-my-level Git-on-my-level changed the title fix(sync): raise prod backfill lookback to 60 days fix(sync): 60-day backfill lookback and Unlimited 24 h/day STT cap deferred at upload Nov 18, 2026
@Git-on-my-level
Git-on-my-level merged commit e338a9a into main Nov 18, 2026
67 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/sync-backfill-60d branch November 18, 2026 18:59
Git-on-my-level added a commit that referenced this pull request Nov 18, 2026
#25677 moved the unlimited_v2 backfill day cap from process_segment to upload
admission. pipeline.py stays deleted; the same process_segment change is
ported to legacy_segment_core.py, where this PR moved that function.
routers/sync.py keeps main's backfill_hours_cap import without the deleted
minimal_redrive/redrive_policy imports. test_sync_backfill_day_cap_upload.py
reads process_segment from legacy_segment_core and observes batch admission
instead of the deleted create_sync_job.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kriegcloud pushed a commit to kriegcloud/omi that referenced this pull request Nov 18, 2026
…e-drain class

SYNC_BACKFILL_MAX_AGE_SECONDS is 60 days in production since BasedHardware#25677 (30 on
dev and in the code default). Prose only; status, family and canonical
prevention are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 19, 2026
…c lookback (#25687)

The server sync lookback rises to 60 days in production (#25677). Orphan
auto-recovery stopped at 28 days and reclaim deleted unreferenced orphans
over 45 days, so 28-60-day orphans were admissible but never recovered and
45-60-day orphans were deleted while the server would still accept them.

Derive both from one constant, serverSyncLookbackSeconds (60 days):
recovery window 58 days (two days inside), reclaim age 67 days (lookback
plus the retention contract's 7-day margin_days, strict). A test fails if
the reclaim age is not strictly beyond recovery plus margin. The too-old
copy no longer names a day count. Kill switch semantics unchanged.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 19, 2026
## Change

Sync upload intake now parks a new Omi-funded GPU job when the existing
batch-funded resolver returns `plan_allowance_exhausted` from a verified
monthly usage total. The previous path created a runnable job and
deferred it after the worker leased it. Intake selects the definitive
refusal after routing and staging, then the admission transaction writes
the existing `allowance_held` shape, the owner count, and the ordinary
receipt together. The scheduler omits the ready-queue link. Replay
returns the earlier receipt and count.

`accept_upload` knows the action's lane and frozen GPU/BYOK route at the
probe. The existing worker maps this same monthly refusal to
`allowance_exhausted` on both fresh and backfill lanes. The independent
Unlimited V2 backfill day cap is enforced at sync upload under #25677.
The probe uses the qualified monthly reader only, has a one-second
request budget, and accepts a ready meter document without rebuilding or
scanning hourly usage. Provider, BYOK, native-record, budget, consent,
ambiguous, and transient cases use their existing paths. The production
Cloud Run manifest enables the monthly reader on backend-sync and
backend-integration and keeps it off on backend and
backend-sync-backfill.

The admission transaction compares the controller's release fence and
the UTC usage month. A raced generation check or rollover returns the
unit to ordinary admission. The existing controller owns capture-ordered
release and every released unit meets the same lease-time authorization.
Existing privacy, staging, receipt, and purge fences protect the new
entry path.

## Flags and mixed versions

`BATCH_ALLOWANCE_INTAKE_PARK_ENABLED` defaults to enabled. The dev and
prod Cloud Run manifests render `true` for `backend-sync` and
`backend-integration`, and `false` for `backend` and
`backend-sync-backfill`. Intake also requires
`BATCH_ALLOWANCE_PARK_ENABLED`. Set the intake switch to `off` on upload
roles to restore new upload queueing followed by ordinary worker
parking. Re-enable with `true`. The original switch controls the
existing gradual drain for rollback past the parking protocol. Keep a
parking-aware controller until that drain finishes.

The frozen `ef42ee8` scheduler walks owner queue links for pulls and
only recovers leased or retry rows. Its pending queries require
`merge_pending=true`. New held rows have no queue link and
`merge_pending=false`. On mixed intake revisions, older hosts create the
existing runnable shape and newer hosts can create the existing held
shape. Both reuse the same receipt ownership, privacy, and release
paths.

## Expected savings (inferred)

Each direct park avoids the initial GPU lease and defer for that unit,
along with its associated queue work. The intake probe adds an
owner-fence read and a bounded funded lookup per qualifying upload. Net
Firestore reads, upload latency, and time from upgrade to release
require an authorized serving comparison. Existing all-reason deferral
and recovery-park counters describe different event streams. Compare the
committed `batch_intake` decision series with allowance-specific
`batch_gpu` refusals, lease rates, held-owner depth, and release
latency.

## Verification

- `backend/test.sh` with selected lists, nine unit files passed across
the original run and the flag-budget rerun. Covered normal upload
routing, definitive and transient answers, BYOK, switch-off, replay,
scheduler and lifecycle guards, and verified-only monthly reads.
- On the rebased head, `backend/test.sh` passed 432 tests across the
five selected files for upload routing, allowance holds, batch unit
policy, verified monthly usage, and the independent upload day cap.
- `python -m pytest -m integration
tests/integration/test_batch_allowance_holds.py
tests/integration/test_conversation_batch_purge_emulator.py`, filtered
to the new cases. Passed two simulator cases, two Postgres 16 cases, and
three loopback Firestore cases. Verified pending and lease exclusion,
ordered release, release-generation fencing, replay, audio erasure and
purge count idempotency.
- `bash backend/scripts/pre-deploy-check.sh` passed all 632 tests and
the dev/prod source validators. Flag registry, parser, policy guard, and
rendered runtime manifest drift checks passed.
- `PYTHONPATH=backend python backend/scripts/cross_service_contract.py`
passed with zero new violations and zero stale gaps. The local
cross-service unit file hit its wall limit under shared host load. Its
fixture now reuses the native safe manifest reader and the existing
reader inventory for a chart-only mutation. The test matrix and timeout
are unchanged. The isolated `python -m pytest -m 'not integration and
not slow' tests/unit/test_cross_service_deploy_contract.py` completed on
the rebased head with 34 passed and 3 opt-in replay cases skipped.
- The local push hook passed all 49 shared preflight checks, including
the async and Firestore guards. Full `backend/scripts/typecheck.sh`
reported zero errors. The metadata check passed with this PR body. Local
proofs used synthetic fixtures and no GCP tier.

- The first GitHub run failed the call-phase CPU guard in two upload
suites and one existing record-seal suite. The upload probe now checks
eligibility in intake and performs billing imports inside the bounded
executor call. A pytest setup fixture initializes the legacy seal
helpers. The test assertions and timing threshold remain the same. The
focused suites passed 549 upload and batch-policy tests and 219
record-seal tests. [Backend unit
workflow](https://github.com/BasedHardware/omi/actions/runs/44387423715)

## Scope panel

`scope-20261118t145633-d607` returned DeepSeek. Luna and GLM timed out
on the shared launch journal and both returned in the replacement panel
`scope-20261118t150434-f81d`. Scope dossiers have no finding IDs and the
triage CLI rejects F1 for this role.

- Accepted the bounded same-policy probe and ordinary path on failures.
A verified-only monthly meter read avoids intake rebuilds and scans. The
independent day cap stays with sync upload admission.
- Accepted avoiding queue or control writes on the held path. The shared
writer keeps one shape and one transactional count increment for a new
job. The path stays within the lead2-owned batch-custody family and its
existing Store transaction and release fences.
- Accepted separating intake and lease telemetry, preserving the
no-BYOK/no-provider exclusions, keeping billing imports lazy in upload
intake, and testing rollback, replay, privacy, and store compatibility.
- Accepted release-controller capacity and stale usage correction as
rollout risks. A separate owner-led canary can measure the added load.
Mid-period usage corrections follow the existing release generation
semantics.
- Chose an independent intake rollback switch. That gives operators the
old create-then-park path without draining existing holds. Controller
changes, fleet changes, source-ledger migration and changes to policy or
custody are outside the lane.

## Review panel

`review-20261118t200614-bd83` reviewed `6ff70f8446de`. Luna's F1 was
accepted and triaged. DeepSeek returned an empty terminal result and GLM
failed to launch. F1 now checks for an eligible new GPU unit in a mixed
upload. The regression reproduced the missed probe and verified that an
exhausted new unit parks, the reused unit becomes `result_ready`, and
the transaction increments the held count once. Both selected suites
passed all 272 tests. The panel identified batch custody as lead2-owned
for any later merge decision.

## Round 2 review and CI fix

`review-20261118t205848-2fce` reviewed `56c9d518c14`. Both findings were
recorded with `omi-panel triage review-20261118t205848-2fce F1=accept
F2=accept`.

- F1 accepted. The shared manifest restricts the switch to
`backend-sync` and `backend-integration`. A rendered-state test pins the
explicit values for all four Cloud Run roles in dev and prod.
- F2 accepted. The STT cap dispatch guide lists `batch_intake`; a unit
test compares the documented inventory with the emitter enum.
- The previous backend shard 5/8 passed all 296 pytest cases. The
`test_control_sync_routing_validates_deployed_values_without_changing_manifest[all]`
call used 1.07 seconds of CPU against a 1.00-second guard. The test now
reuses the parsed manifest across its validator calls and keeps its
assertions and guard. [Prior shard
log](https://github.com/BasedHardware/omi/actions/runs/44395532709/job/135129289573)
- Round 2 local verification passed
`backend/scripts/pre-deploy-check.sh` with the 1.00-second CPU guard
(636 tests), `backend/test.sh` on five selected STT, upload and flag
suites, `backend/deploy/compose_runtime_env.py --check`, and
`scripts/check_feature_flag_registry.py`.

## Product invariants affected

- INV-MEM-4. The batch receipt owns audio custody through scheduling.
The existing projection and canonical promotion paths own memory
mutation.

This feature introduces intake parking. Pre-publication changes
corrected flag wiring. GitHub CI then exposed cold imports inside the
timed upload and record-seal test calls.

Failure-Class: FC-test-cold-import-in-call-budget

Line-Count-Exception: backend/utils/subscription.py | 1858 -> 1874 | The
bounded intake read shares the resolver and launch-date policy. Moving
the billing module would widen this change.



<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/25722?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/25722?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F25722&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->

Implemented by a delegated agent for the batch owner-state program.
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