Skip to content

fix(app): treat confirmed-subscription quiet as listening, warn only on real pendant audio failures - #23703

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/capture-quiet
Oct 26, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/capture-quiet

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

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 OmiCaptureHealth already treats a confirmed subscription over silence as healthy — its quiet phase (fresh_subscription_quiet / budget_spent_quiet) is a settled, non-failing state (silenceAfterFreshSubscriptionIsFailure = false, and it costs no recovery budget). But Dart's CaptureIngressHealth.verifiedAt recognized only a flowing audio lease, so quiet projected to unverified: 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 — a fresh_subscription_quiet that never delivered a packet in its generation (a CCCD confirmed but never notifying) would have claimed Listening forever.

Separately, ClientTelemetrySchema.ingressPhases never learned the native phases (inactive, unverified, repairing, reconnecting, quiet), so capture_ingress_unmapped_phase {phase: unmapped} logged instead of the real phase.

Change

  • A quiet that already delivered audio this generation verifies (capture_ingress_health.dart): verifiedAt now accepts a current audio lease or a confirmed-subscription quiet whose generation has audio of its own — native's snapshot already carries last_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 — a fresh_subscription_quiet (or budget_spent_quiet on 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 the native_ingress capture-started telemetry, so a zero-audio link marks no recording started.
  • A real failure is named, once, with an action. actionRequired (native recovery exhausted, or an unconfirmed subscription past the island grace) becomes the one warning state:
    • Island: noAudio shows the unheard notice immediately (no grace), with the plain-words line "Pendant connected, but no audio is reaching your phone" and a Reconnect button (new reconnect Live Activity action → CaptureController.reconnectRecordingPendant(), one disconnect-and-reconnect through the same managed recoverConnection the 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.
    • Home live row: amber "No audio from pendant" as the title with the plain-words line under it — never "Listening now" — and a compact Reconnect action instead of the chevron; a wait shows "Connecting…" and claims neither Listening nor a time.
    • Device Settings "Right now": warning row ("No audio from pendant" / the plain-words line); tapping it reconnects. A wait shows "Connecting…" without a running length.
  • Telemetry: the schema now carries the native phases (legacy names stay accepted); capture_ingress_unmapped_phase logs the actual phase name. The backend's mirror set accepts the same phases so they are not bucketed to unknown.
  • Live Activity policy extracted to OmiCapturePresentationPolicy.swift (Foundation-only) so the decision is host-testable; noAudio warns immediately, connecting/unverified keep the 2-minute grace, healthy quiet never warns. The notice strings are localized in the widget catalog (49 locales) alongside a new Reconnect key.

State → presentation after this change

Native health Island Home live row Device Settings badge
flowing (lease valid) nothing (healthy) Listening · running time Listening now · live length
quiet + confirmed subscription, audio heard this generation (silent room) nothing — no more false warning Listening · running time (clock no longer freezes) Listening now · live length
quiet + confirmed subscription but no audio this generation (fresh-subscription wedge), or any wait / repair / reconnect within grace no card for 2 min Connecting… (no time, dot still) Connecting… (no length)
unverified past the 2-minute grace (subscription never confirmed, or the confirmed-but-never-delivering quiet above) unheard notice + Reconnect Connecting… — and "No audio from pendant · Reconnect" once native recovery exhausts to actionRequired (an unconfirmed subscription walks the repair/reconnect ladder; a confirmed-but-silent quiet stays Connecting…) Connecting… — warning row once actionRequired
actionRequired (recovery exhausted) unheard notice immediately + Reconnect No audio from pendant · plain-words line · Reconnect Warning row (No audio from pendant / plain-words line), tap reconnects

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 in capture_socket_generation_test.dart, including the fresh-quiet-claims-nothing and zero-audio-marks-no-start cases; the replayed incident trace in native_ble_transport_resync_test.dart whose zero-notification quiet now never verifies; and the host-run omi_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 (noAudio warns 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 — includes capture_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 in capture_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, the native_ble_transport_resync_test incident 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.rb also passes unchanged (native health is untouched this round; it already pins the lastAudioAt per-generation reset the Dart proof reads).
  • Backend: 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":

Home row quiet dark
Home row failure dark
Home row quiet light
Home row failure light
Device badge quiet dark
Device badge failure dark
Device badge quiet light
Device badge failure light

Live Activity views have no snapshot tooling in this repo; the island's behavior is pinned by ios-capture-presentation instead.

Changelog: app/changelog/unreleased/20261026-capture-quiet-not-failure.json.

Co-Authored-By: Claude Opus 5.5 [email protected]

🤖 Generated with Claude Code

…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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T10:04:14.144290Z 0ff0430 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +231 to +232
final noAudio = isDeviceRecording && !provider.isPaused && provider.pendantCaptureActionRequired;
final unverified = isDeviceRecording && !provider.isPaused && !provider.pendantCaptureVerified && !noAudio;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +175 to +178
OmiButton.secondary(
key: const Key('home_live_episode_reconnect'),
label: l10n.reconnect,
onPressed: () => capture.reconnectRecordingPendant(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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]>
@Git-on-my-level
Git-on-my-level merged commit fd000d9 into main Oct 26, 2026
68 of 70 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/capture-quiet branch October 26, 2026 10:40
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