Skip to content

Extend the WAL coverage wait memo (SCA-3376) - #26333

Merged
Git-on-my-level merged 1 commit into
mainfrom
agent/m1-studio-codex-sol/f20626c7c2e6
Nov 26, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
agent/m1-studio-codex-sol/f20626c7c2e6

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Change

SCA-3376. Completed negative WAL coverage comparisons now memoize for six hours by default. Redis SET NX sets expiry only on insertion. A coverage memo hit returns the existing retryable HTTP 503 with retry_after_seconds: 1800 in the JSON body. Coverage misses and other custody waits keep the 30-second hint. The fast hit still wakes the partial coordinator. Receipt, handoff, and WAL retention behavior is preserved.

The job snapshot already hashes audio_uri with the exact GCS generation. Audio staging is create-only, and coverage reads pin the generation. Retained manifests pin source generations and verify decoded PCM against their authenticated digests. A replacement generation needs a new job URI to affect coverage, which changes the key. A read or digest failure cannot populate the memo. The regression test accepts the same WAL after a repair switches the job to a newer generation at the same object name, while the old negative remains cached.

Tuning and rollback

  • Coverage memo TTL goes from 300 to 21,600 seconds. SYNC_RECORD_COVERAGE_WAIT_TTL_SECONDS bounds overrides to 30–21,600 seconds and applies on insertion.
  • Coverage-hit JSON hint goes from 30 to 1,800 seconds. SYNC_RECORD_COVERAGE_WAIT_RETRY_AFTER_SECONDS bounds overrides to 30–1,800 seconds.
  • Roll back with SYNC_RECORD_COVERAGE_WAIT_MEMO=false on all serving upload revisions. It bypasses populated entries as well as writes. The new Redis prefix keeps long-lived entries isolated from older code during a mixed-revision rollout or code rollback.

App behavior

Source checks at tagged iOS 1.0.577+1520 and Android 1.0.577+1516 show that those builds use the Retry-After header path and ignore this JSON hint. The macOS 0.12.578+12578 source treats a 503 as a generic retryable upload failure. The Flutter pacing code from #25868 applies at most 300 seconds to a 1,800-second hint. Store adoption and actual retries must be measured by build before estimating fleet savings.

Verification and production readback

  • 187 focused unit tests passed on the M1 Studio through omi-heavy run --wait 300 --timeout 300. Suites covered coverage memo and telemetry, artifacts, WAL handoff, duplicate settlement and the flag budget.
  • All 44 local preflight checks and the repository pre-push verification passed. The historical failure-class ratchet skipped its 90-day scan in the shallow checkout.
  • After release, compare closed, matched UTC windows with revision, traffic split and instance cap recorded. Allow the new memo namespace to warm before scoring. Count coverage hits divided by hits plus misses from sync_record_upload events with path=coverage. Sum request latency in seconds for HTTP 503 on POST /v2/sync-local-files. Compare peak concurrent active backend-sync instances using time-aligned instance counts across revisions. Report successful uploads and oldest observed pending WAL age alongside these results, by app build where available.
  • For the service-level ratio, use Cloud Monitoring request counts from the same revisions and window. The design thread reports about 3.14 HTTP 503s per 202. Report HTTP 503 / (200 + 202) alongside that comparable 503 / 202 series. The targets are >90% coverage hit share, ≥50% fewer upload 503 request-seconds, and <45 peak active instances. Confirm a serving revision before scoring.

Product invariants affected

  • INV-CAP-1. The custody wait retains local WAL and the durable acknowledgment path continues to own audio release.

UI-Evidence: none

View guided diff Turn on auto-fix

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T23:57:25.947421Z 74025e8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Git-on-my-level
Git-on-my-level merged commit 014a1e6 into main Nov 26, 2026
71 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m1-studio-codex-sol/f20626c7c2e6 branch November 26, 2026 05:33
aryanorastar added a commit that referenced this pull request Nov 27, 2026
## What changed and why

The backend can send a 1,800-second `record_capture_pending` wait after
a cached negative audio-coverage check (#26333). The mobile upload gate
capped all recording waits at 300 seconds, so affected recordings could
retry early even after an app restart.

Honor typed recording waits up to 30 minutes. Preserve the five-minute
cap for header fallback and local backoff. Each wait remains scoped to
the recording session. The existing receipt path still controls when a
local recording can be released.

Related: #21216, #25770, #26333.

## Product invariants affected

- **INV-CAP-1** — the wait changes retry timing only. The affected file
remains readable and pending throughout the deferral, with the existing
server receipt still required for release.

## How it was verified

- The restart regression failed before the patch. The queue issued
another request at six minutes despite a 30-minute response.
- 81 focused Flutter tests passed. The updated loopback HTTP test
separately passed with the full 1,800-second response.
- The backend coverage-wait suite passed 27 tests, including the
1,800-second response.
- Analyzer ratchet and all 27 local preflight checks passed.
- Independent review checked the bounds, persisted values, and unchanged
custody logic.
- Production coverage and historical recording recovery require separate
verification.

## Tests

- `recording_wait_deferrals_test.dart` checks typed and header limits,
default waits, and short backoff.
- `wal_upload_resilience_test.dart` checks a restarted queue, a sibling
session uploading independently, retained audio, and exact expiry.
- `wal_retry_manifest_transport_test.dart` verifies the typed 503 over
loopback HTTP, no request during the restored wait, and a queued receipt
after expiry.

## UI evidence

UI-Evidence: none -- Upload retry timing only.

## Failure class

Failure-Class: none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/26396?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/26396?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26396&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. -->
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