Repository navigation
fix(capture): refuse silent pendant voice-question sessions while muted (#20478) - #22057
Conversation
|
The production change here is correct and nicely scoped — this closes the silent-session path from #20478 exactly as the issue's privacy-explicit option describes. Leaving one product confirmation to a maintainer rather than approving. Correctness, file by file:
Security/privacy: positive — this refuses capture-adjacent state while muted rather than bypassing it. USER IMPACT: While the pendant is muted, tapping to ask a voice question now gives a clear failure buzz instead of silently pretending to listen; muting mid-question cleanly discards it. What I'd still want as a reviewer: (1) the new tests run in CI (only the AI reviewer ran on this PR), and (2) maintainer confirmation of the product choice — #20478 also floats allowing one deliberate question while muted; this PR implements the refuse option, which looks right to me, but that call is a product decision, hence needs-maintainer-review. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
|
Thanks for the thorough review and verification, @Git-on-my-level! Regarding the two points:
Looking forward to the maintainer review! |
Git-on-my-level
left a comment
There was a problem hiding this comment.
Since my last review: addressed — CI has now run on this head and Dart Analyze & Tests pass, confirming the tests you pointed to; still open — maintainer sign-off on the mute-vs-question semantics from #20478; newly surfaced — the Hygiene check fails a PR-body contract, the one blocking fix below.
This needs one small, non-code fix before merge. Hygiene fails ui-evidence because app/lib/services/capture/capture_controller.dart counts as UI source and the PR body has neither a tracked screenshot reference nor an explicit escape line. This change intentionally has no visual UI (feedback is haptic-only), so add this exact line to the PR description:
UI-Evidence: none -- no visual UI change; refusal feedback is haptic-only
Correctness re-verified on the current head:
capture_controller.dart~798 (_setCaptureMuted): cancelling the active non-onboarding voice session on the mute transition kills the 15s auto-submit timer so a mid-question mute cannot later submit stale frames — exactly the privacy-explicit option #20478 describes.capture_controller.dart~2046 and ~2085 (single-tap, legacy long-press): refusing while muted logspendant_voice_question/refused_mutedand plays the distinct double-pulse failure haptic — unambiguous tactile feedback that mute is honored.capture_controller.dart~2136 (streamAudioToWs):collectCommandAudionow also requires!isPaused(interactive onboarding still exempt); precedence reads correctly and it is sound defense-in-depth if a session ever slips pastcancelActiveVoiceSession.omi_button_actions_controller_test.dart: the new tests assert session state, haptic pulses ([1,1,1,1]), zero socket sends, and bothrefused_mutedevents, plus the mute-mid-question cancel path — good coverage of both entry points.
USER IMPACT: while the pendant is double-tap-muted, a single tap or long-press no longer silently pretends to start a voice question — it is refused with a distinct double-buzz haptic, and muting mid-question now cancels the question cleanly.
No new queries, latency, or external API cost; the behavior change is strictly more privacy-conservative. Once the UI-Evidence line is added and Hygiene goes green, the only remaining item is the maintainer product call on what mute authorizes (review already requested) — the on-device repro suggested in #20478 stays unverified, but the state machine is unit-covered.
by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.
|
@Git-on-my-level need human response Updated the PR description with the exact requested line: UI-Evidence: none -- no visual UI change; refusal feedback is haptic-only The source head is unchanged ( A human maintainer product decision is still needed for #20478: this implements explicit refusal of a voice question while muted, with haptic feedback, rather than temporarily overriding mute. Physical pendant behavior remains unverified. |
Resolved: the PR body now contains the exact required line "UI-Evidence: none -- no visual UI change; refusal feedback is haptic-only", which satisfies the Hygiene ui-evidence contract; this was the only blocking item from this review. Head unchanged. Remaining before merge: maintainer product sign-off on #20478 semantics and on-device haptic verification.
|
Since my last review: addressed — the PR body now carries the exact Verdict: the production change is correct and complete for what it claims; from my side this is ready for maintainer sign-off. Head is unchanged ( Code, for the record:
Blast radius: pendant button behavior only, and only while muted; the onboarding path is explicitly exempted. Performance/cost impact negligible (a boolean check per button event). Privacy strictly improves — no audio can be captured, buffered, or submitted while the user has muted the device. USER IMPACT: while the pendant is muted, a single tap no longer silently opens a dead voice-question session — you feel a distinct double-buzz "muted" haptic instead, and muting mid-question immediately cancels it. Still wanted before merge: (1) maintainer sign-off on the #20478 product choice (refuse-with-haptic rather than temporarily overriding mute), (2) on-device verification of the double-pulse haptic on a physical pendant, and (3) maintainer approval of the pending workflow run so Hygiene/Detect Changes confirm the updated PR body on CI — the escape line matches the contract, so it should pass. Leaving for human maintainer review: the mute-vs-question product decision and physical-pendant verification are maintainer calls, not automation calls. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
86f4aae to
68f2811
Compare
Fixes #20478
Summary
Prevents a pendant single-tap (or legacy long-press) from starting a silent, non-capturing voice-question session while double-tap mute (
isPaused) is active:CaptureController._handleButtonEvent):isPausedis true (outside interactive device onboarding),buttonState == 1(single-tap toggle) andbuttonState == 3(legacy long-press) refuse to start_voiceCommandSession, emitDebugLogManager.logEvent('pendant_voice_question', {'phase': 'refused_muted'}), and play the double-pulse failure haptic (_playVoiceQuestionFailureHaptic(deviceId)) instead of the single-pulse start acknowledgement.buttonState == 1orbuttonState == 5with_voiceCommandSession != null), cancels the session viacancelActiveVoiceSession()instead of submitting empty/partial frames.CaptureController._setCaptureMuted):muted == true), any active non-onboarding_voiceCommandSessionis immediately cancelled viacancelActiveVoiceSession()so double-tapping to mute mid-question does not leave a 15s timer running.CaptureController.streamAudioToWs):collectCommandAudioby!isPaused(unless interactive onboarding is active).Verification
app/test/providers/omi_button_actions_controller_test.dart:single tap and legacy long press refuse to start a silent voice session while muted (#20478)double-tap mute cancels an active voice question session (#20478)Product contracts and evidence
Product invariants affected: INV-CAP-1. This change refuses a voice-question session during an explicit user mute; it does not authorize automatic audio loss while capture is active.
UI-Evidence: none -- no visual UI change; refusal feedback is haptic-only
Physical pendant haptic behavior has not been verified on-device.
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4517 -> 4540 | Keep the bounded mute admission check beside the existing capture-session authority; splitting the controller is outside this fix.
Failure-Class: none
The fix addresses admission of a voice-question session while the pendant is explicitly muted; no failure-class registry entry is added by this PR.