Repository navigation
fix(app): treat confirmed-subscription quiet as listening, warn only on real pendant audio failures - #23703
Conversation
…on real pendant audio failures The pendant sends audio only while there is sound, so native OmiCaptureHealth settles a silent-but-healthy link into its quiet phase with the subscription confirmed. Dart's verifiedAt recognized only a flowing audio lease, so quiet projected to unverified: the capture clock froze, Listening withdrew, and after the island's 2-minute grace every quiet room read as "No audio from pendant". A confirmed-subscription quiet now verifies (a current flowing lease still does); the clock keeps running and Home, Device Settings and the island keep saying Listening through silence. The #20378 honesty rule holds the other way: waits, repairs, reconnects and exhausted recoveries claim nothing, and a zero-byte wedge still resolves only on a flowing lease, because a confirmed subscription alone does not prove delivery. actionRequired becomes the one warning state: the island's unheard notice appears immediately with the plain-words sentence and a Reconnect action wired to one managed disconnect-and-reconnect; the Home live row and the Device Settings Right-now badge show the same warning with a Reconnect of their own, and a wait reads Connecting… with no time. The telemetry schema learns the native phases (legacy names stay accepted; the backend mirror too) so capture_ingress_unmapped_phase reports the real phase instead of unmapped. The Live Activity notice policy moves to a Foundation-only OmiCapturePresentationPolicy.swift that the new ios-capture-presentation manifest check runs on the host, alongside locale-completeness of the notice strings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis 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: 497b2da3ef
ℹ️ 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".
| final noAudio = isDeviceRecording && !provider.isPaused && provider.pendantCaptureActionRequired; | ||
| final unverified = isDeviceRecording && !provider.isPaused && !provider.pendantCaptureVerified && !noAudio; |
There was a problem hiding this comment.
Preserve failed ingress state in the batch capture card
When an Omi pendant is in Transcribe Later mode and native recovery reaches actionRequired, noAudio becomes true and now forces unverified to false. The batch branch only passes unverified to _buildBatchRecordingUI, which consequently falls through to “Recording” / “Audio saved, transcribes later” and can show an elapsed time despite the failed audio link. Previously this state remained unverified. Pass the failure state into the batch renderer and display the no-audio warning instead of claiming audio is being saved.
Useful? React with 👍 / 👎.
| OmiButton.secondary( | ||
| key: const Key('home_live_episode_reconnect'), | ||
| label: l10n.reconnect, | ||
| onPressed: () => capture.reconnectRecordingPendant(), |
There was a problem hiding this comment.
Expose the reconnect button to accessibility services
For VoiceOver and TalkBack users, the new Reconnect button is inside the row’s existing Semantics(excludeSemantics: true), so its label and action are removed from the accessibility tree. The only exposed action remains the parent’s onTap: open, which opens the live episode rather than reconnecting the pendant. Give the recovery button its own accessible semantics outside the excluded subtree, or restructure the row semantics so both actions remain available.
Useful? React with 👍 / 👎.
…ilure, guard Reconnect Review fixes for #23703 round 1: - Honesty rule (#20378): a confirmed-subscription quiet verifies only when its generation already delivered audio. Native's snapshot has carried last_audio_at_ms all along (reset on every generation change and on a failed subscription), so verifiedAt now requires it for quiet: a fresh_subscription_quiet or budget_spent_quiet with no audio this generation stays unverified - the island grace, then the unheard notice with Reconnect - instead of Listening with a running clock forever. The same predicate gates the native_ingress capture-started telemetry, so a zero-audio link marks no recording started. - The Home live row's failure state never says Listening: the title is "No audio from pendant" with the plain-words line under it. - A reader's Reconnect coalesces concurrent taps into one managed reconnect (pendantReconnectInFlight; Home and Device Settings disable their action while it runs), is a no-op when the reader paused capture or disconnected the pendant themselves (the manual-disconnect choice is never cleared), and a tap with no pendant reports to the surface instead of an uncaught StateError. - The replayed zero-notification incident trace now asserts nothing ever verifies; the regenerated evidence shots carry the corrected copy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: new
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4566 -> 4644 | the controller gains the seams the failure surfaces call (pendantCaptureActionRequired projection, reconnectRecordingPendant through the injected loader, and the reconnect's in-flight coalescing guard); splitting the 4.5k-line controller is its own change
Product invariants affected
INV-CAP-1 — this change is presentation on top of the capture-health machine, never custody: it reclassifies how a native phase maps to a Listening claim or a warning, not whether captured audio survives. No subscription, recovery-budget, retention or radio policy changed (the pendant keeps its confirmed subscription through quiet, and the native machine is untouched), and the one new user action is the same managed reconnect the wedge monitor's retry already uses.
What
A pendant that goes silent in a quiet room after delivering audio kept capture healthy but presented as failing: the Dynamic Island showed "No audio from pendant" (slashed waveform), the Home live row froze at "Listening now · Capturing · 0s", and Device Settings kept "Listening" — three contradictory signals, all wrong. Every silent stretch longer than the 2-minute island grace was a false alarm.
Root cause
The pendant only sends audio packets while there is sound (the filed evidence shows ~8 minutes of packets in a 90-minute wear, zero packet loss). Native
OmiCaptureHealthalready treats a confirmed subscription over silence as healthy — itsquietphase (fresh_subscription_quiet/budget_spent_quiet) is a settled, non-failing state (silenceAfterFreshSubscriptionIsFailure = false, and it costs no recovery budget). But Dart'sCaptureIngressHealth.verifiedAtrecognized only a flowing audio lease, soquietprojected tounverified: the clock froze, the Listening claim withdrew, and the island warned after its grace. Review fix (round 1): the first cut let any confirmed-subscription quiet verify, which broke the #20378 honesty rule the other way — afresh_subscription_quietthat never delivered a packet in its generation (a CCCD confirmed but never notifying) would have claimed Listening forever.Separately,
ClientTelemetrySchema.ingressPhasesnever learned the native phases (inactive,unverified,repairing,reconnecting,quiet), socapture_ingress_unmapped_phase {phase: unmapped}logged instead of the real phase.Change
capture_ingress_health.dart):verifiedAtnow accepts a current audio lease or a confirmed-subscription quiet whose generation has audio of its own — native's snapshot already carrieslast_audio_at_ms, which resets to 0 on every generation change and a failed subscription, so it is exactly "this link has delivered". The clock keeps running and every surface keeps saying Listening through silence after sound. The honesty rule from fix(app): verify pendant capture from arriving audio and recover a silent link #20378 holds in both directions: unconfirmed subscriptions, repairs, reconnects and exhausted recoveries claim nothing, and a confirmed subscription alone still proves nothing — afresh_subscription_quiet(orbudget_spent_quieton a fresh generation) with no audio this generation stays unverified, keeps the wait grace, and reaches the unheard notice with Reconnect. A zero-byte wedge episode still resolves only on a flowing lease (audioLeaseValid). The same predicate gates thenative_ingresscapture-started telemetry, so a zero-audio link marks no recording started.actionRequired(native recovery exhausted, or an unconfirmed subscription past the island grace) becomes the one warning state:noAudioshows the unheard notice immediately (no grace), with the plain-words line "Pendant connected, but no audio is reaching your phone" and a Reconnect button (newreconnectLive Activity action →CaptureController.reconnectRecordingPendant(), one disconnect-and-reconnect through the same managedrecoverConnectionthe wedge monitor's retry uses; it never loops and never spends the native recovery budget). Review fix (round 1): the reconnect now coalesces concurrent taps into one attempt (pendantReconnectInFlight; Home and Device Settings disable their action while it runs, the Live Activity already serialized its intents), is a no-op when the reader paused capture or disconnected the pendant themselves — the manual-disconnect choice is never cleared — and a tap with no pendant to reconnect reports failure to the surface (snackbar on Home, the card's failure mark) instead of an uncaught error.capture_ingress_unmapped_phaselogs the actual phase name. The backend's mirror set accepts the same phases so they are not bucketed tounknown.OmiCapturePresentationPolicy.swift(Foundation-only) so the decision is host-testable;noAudiowarns immediately,connecting/unverifiedkeep the 2-minute grace, healthy quiet never warns. The notice strings are localized in the widget catalog (49 locales) alongside a newReconnectkey.State → presentation after this change
Why a new failure class
Failure-Class: new—FC-healthy-silence-projected-as-failure: a producer state with a specified healthy meaning was consumed through a stale narrower predicate and projected as failure. Its guard surface is the state-mapping tests on both sides of the boundary (capture_quiet_health_test.dart— quiet verifies only with audio this generation, a fresh quiet does not, a new generation resets the proof; the quiet/noAudio cases incapture_socket_generation_test.dart, including the fresh-quiet-claims-nothing and zero-audio-marks-no-start cases; the replayed incident trace innative_ble_transport_resync_test.dartwhose zero-notification quiet now never verifies; and the host-runomi_capture_presentation_test.rb).New check
ios-capture-presentation(manifest, local+ci lanes) runs the new policy test. It pins the island side of the mapping this bug crossed (noAudiowarns immediately, the grace applies only to waits, healthy statuses never warn) and the presence of every notice string in every widget locale. It is not a shared primitive because nothing host-compiles the ActivityKit-gated presentation sources; the policy extraction into a Foundation-only file is what makes the real decision runnable on CI hardware.Tests
app bash test.sh(full hermetic suite): 7517 passed, 0 failed — includescapture_quiet_health_test.dart(a quiet verifies only with this generation's audio, a fresh quiet without audio does not, a new generation resets the proof, unconfirmed quiet does not, telemetry phase mapping), quiet/noAudio provider + Live Activity surface cases incapture_socket_generation_test.dart(clock runs through quiet-after-audio; a fresh quiet claims nothing, marks no capture start and reports unverified to the island; noAudio publishes and its card action reconnects once; reader Reconnect coalesces concurrent taps and is a no-op after a pause or a manual disconnect), the Home-row and Device-badge widget cases (the failure row never says Listening), the revised intent tests (capture_ingress_health_test, thenative_ble_transport_resync_testincident replay whose zero-notification quiet now never verifies, wedge monitor resolution stays lease-based), and the visual-audit suite.app/ios/test/omi_capture_presentation_test.rb: 303 assertions — policy decisions for every status, iOS-SDK typecheck of the Live Activity sources, and locale completeness of the notice strings.app/ios/test/omi_capture_health_test.rbalso passes unchanged (native health is untouched this round; it already pins thelastAudioAtper-generation reset the Dart proof reads).backend .venv/bin/python -m pytest tests/unit/test_client_telemetry.py— 21 passed (new: native phases pass through unbucketed).scripts/l10n.py check: 49 locales, 4270 keys, placeholders/freshness ok.UI-Evidence
Rendered with the repo's widget-test pipeline (same renderer as
visual_audit.sh; its font rasterizer draws placeholder glyphs, so text reads as bars — the exact strings are pinned by the widget tests). Light/dark, quiet vs real failure. The failure shots carry the corrected copy: the row titles "No audio from pendant" with the plain-words line under it, never "Listening now":Live Activity views have no snapshot tooling in this repo; the island's behavior is pinned by
ios-capture-presentationinstead.Changelog:
app/changelog/unreleased/20261026-capture-quiet-not-failure.json.Co-Authored-By: Claude Opus 5.5 [email protected]
🤖 Generated with Claude Code