Repository navigation
fix(app): recover stalled Android Custom Live Pendant audio - #25975
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1899388f6e
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!_isInitialized) return; | ||
|
|
||
| try { | ||
| stopCustomLiveAudioWatch(); |
There was a problem hiding this comment.
Retain the watchdog binding across temporary flash drains
When flash audio is transferred during an admitted Android Custom Live recording, FlashPageWalSync._syncWal() calls enableBatchMode() and later enableRealTimeMode() without restarting capture. Calling stopCustomLiveAudioWatch() here clears both the current monitor and _startCustomLiveWatch, so disableBatchMode() can only arm the legacy startup monitor, which disarms after the first decoded frame. Subsequent midstream stalls therefore remain unrecovered for the rest of that capture, including after BLE reconnects. Close the current monitor while flash owns the link, but retain the ownership-checked binding so returning to realtime can reinstall it.
Useful? React with 👍 / 👎.
#26131) ## Summary Follow-up to #25975 for SCA-3616. Refreshing transcription settings keeps the Android Custom Live watchdog when the admitted recording and STT configuration still match. The existing timer, one-retry budget, and pending outcome survive the refresh. A changed configuration or retired capture invalidates the old watch. ## Verification - Both regressions failed before the fix. The public settings refresh replaced the watch, and refreshing after the retry write immediately reported `censored` while recovery was pending. - On Flutter 3.44.5, all 50 focused tests passed across `tiered_capture`, `resume_sync_fence`, `transcription_settings_retention`, `limitless_golden`, `limitless_realtime_health`, and `recording_lifecycle_telemetry`. The pending retry reports `exhausted` once and issues a single BLE reactivation write. The capture replay also verifies config and account changes invalidate the old watch. - Verification used a scripted BLE transport on the M1 host. - `make preflight` passed all 27 selected checks. ## Product invariants affected - INV-CAP-1. The admitted Limitless recording keeps its bounded recovery watch through an unchanged settings refresh. Failure-Class: FC-callback-replenishes-link-retry-budget UI-Evidence: none Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 5014 -> 5018 | Keep explicit teardown for ineligible recovery while allowing a valid watch to survive settings refresh. Line-Count-Exception: app/lib/services/devices/connectors/limitless_connection.dart | 2294 -> 2299 | Retain the ownership predicate with the reconnect binding so a refresh reuses the admitted retry budget. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/26131?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> <!-- End of auto-generated description by cubic. -->
Integrate David Zhang's Custom Live capture fix (f091e05, merged in BasedHardware#25975) and later main. Conflict in CompositeTranscriptionSocket.send and its tests is resolved in favor of main's OMI_CUSTOM_LIVE_CAPTURE_FIX gate so Custom Live flag behavior stays intact. The broader custom-STT rule lands in a follow-up commit on top of that flag.
…ers (BasedHardware#24191) Main's f091e05 (merged in BasedHardware#25975) already keeps Omi control text off the Custom Live primary, behind OMI_CUSTOM_LIVE_CAPTURE_FIX. Every other custom STT primary (polling, streaming, Gemini) is also audio-only, so the same flag now covers them too. Disabling the flag still restores the old send-text-to-primary path for Custom Live and those providers together. No second switch is added. Custom Live evidence pairing and flag-off behavior from main are unchanged.
…tings (#26324) ## What changed and why Add direct `CompositeTranscriptionSocket.send(List<int>)` regression coverage alongside the Custom Live evidence-frame tests from #25975. With either raw-audio consent setting, Custom Live receives the exact payload once. Omi receives the same payload once with consent and receives nothing after opt-out. The mobile changelog fragment marks the test-only change as internal. ## Product invariants affected none ## How it was verified - `bash test.sh test/unit/composite_transcription_socket_test.dart --reporter expanded` from `app/` passed all 32 composite socket tests and 138 protected contract tests on Apple Silicon with Flutter 3.44.5. - `make preflight` passed. The history-based failure-class check was skipped in the shallow checkout. ## Tests The existing composite socket suite runs separate direct-send cases for opt-in and opt-out using the suite's fake sockets. UI-Evidence: none -- test-only change <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/26324?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> <!-- End of auto-generated description by cubic. -->
Summary
Supersedes #23643 for Android Custom Live realtime capture. SCA-3592 owns design, acceptance and release follow-through.
Verification and release
460379212835226dfbc3baa7b37b16b373f2bf55before the socket fix. All 86 focused tests passed on Flutter 3.44.5. The suites exercise the raw-audio consent pair, decoded-frame stall retry and link loss, sustained frame progress, pending-write ownership, reconnect telemetry and the protected capture paths.Recording Observationby app version/build. Count one detection-eligible and one detection-enabled/disabled observation per recording, and report restored, exhausted and censored outcomes. Report exhausted episodes per 1,000 detection-enabled recordings alongside enabled/eligible coverage. Older builds lack the Custom Live session dimension, so SCA-3592 records the historical baseline as unavailable. Use the first complete qualifying 24 UTC hours on the first instrumented build for the production baseline.android-custom-live-audio-recovery-kill. Full rollback is a rebuild with--dart-define=OMI_CUSTOM_LIVE_CAPTURE_FIX=falseor a revert. No backend write, new endpoint, or audio retention change.Product invariants affected
Failure-Class: new
UI-Evidence: none
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 5095 -> 5175 | Bind watchdog admission and telemetry to the admitted recording, account and BLE connection.
Line-Count-Exception: app/lib/services/devices/connectors/limitless_connection.dart | 2237 -> 2294 | Connect realtime health to BLE setup, decoded audio and generation teardown.
Review provenance
review-20261121t180552-ffc0reviewedf091e051a8f8e9809f1fb8aa4339b4ce81b130c5. Two reviewers returned SHIP. The third timed out. The controller-level coverage finding was accepted and tested on the next head.review-20261121t183640-a410reviewed7ea054a3f366f9f50545f166c5d8164f7a32e780. The retained-capture reconnect finding was a blocker. The other answered reviewer raised three nonblocking findings. The third timed out. All four findings were triaged.1899388f6ea4f10e93542c194391de3963694cfdunder the two-round rule. The disposition and regression evidence are on SCA-3592. Regular binary consent routing passed a supplemental local replay. Maintained coverage and unchanged-settings refresh behavior are tracked in SCA-3617 and SCA-3616.