Skip to content

fix(app,backend): stop pendant questions from vanishing silently and unify the answer voice - #19431

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/pendant-ask-silent-drop-and-voice
Sep 27, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/pendant-ask-silent-drop-and-voice

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

What

  • Treat the modern pendant's single tap (1) followed by release (5) as one toggle-mode start instead of a complete legacy long-press interaction. A second single tap ends the question; legacy long press (3) followed by release (5) remains supported.
  • Route production button notifications and tests through the same handler, add a two-second post-auto-submit grace window, persist warnings plus a typed bounded-reason analytics event for silent-drop boundaries, and put a 60-second bound around the voice reply stream.
  • Turn voice-chat VAD silence into an explicit released-client-compatible error: SSE frame. Current clients render the localized Didn't catch that — try again state and play a short failure haptic when supported.
  • Use Gemini Charon plus a neutral, natural-paced style for the mobile mapping and desktop fallback. Explicit desktop voice selections and TTS_PROVIDER=legacy are unchanged.

The in-flight progressive-playback work owns app/lib/services/voice_playback/omi_voice_playback_service.dart; this PR intentionally does not change its chunk sizing.

Why and evidence

The causal failure is the client button state machine, not Transcribe Later, language selection, an Opus/PCM mix-up, or a Parakeet empty-result fallback:

  • Current Omi firmware emits 1 for a short tap and then emits 5 on the following release/debounce cycle. The shipping app started toggle recording on 1, then its legacy release branch immediately ended it on 5. The onboarding tutorial appeared to work because its step interceptor allowed state 1 through but consumed state 5.
  • In the owner-reported 2026-09-27 11:53–12:11Z window, production Cloud Run request logs contained 26 successful /v2/voice-messages HTTP 200s: 17 empty-SSE responses (65.4%) completed in 0.2308–0.4016s with median request size 2,435 bytes, while 9 answer-producing responses took 1.85–13.46s with median request size 20,405 bytes. That tiny/fast cohort matches the immediate 1 -> 5 submit.
  • Managed transcription metrics for the prior seven days recorded 8,999 expected_silence outcomes among 15,396 voice_chat_sse attempts (58.46%). By selected provider/platform: Modulate Android 48/132, Modulate iOS 2,260/2,444, Parakeet Android 1,605/3,464, and Parakeet iOS 5,086/9,355. The provider label is selected before strict VAD; an expected-silence attempt returns before any provider call, so these counts do not show Parakeet returning empty.
  • audio_fs320_*.bin is intentionally decoded as Opus: only _pcm16_ and _pcm8_ names enter the raw-PCM branch. The frame size is carried separately in the filename. The suspected codec misclassification is therefore disproven.
  • get_prerecorded_service selects one supported configured provider and the prerecorded path invokes it once, so there is no post-empty fallback. That code observation is true, but it is not causal here because the incident's strict-VAD silence exits before Parakeet is called. This PR does not introduce an unrelated provider/cost-policy change.
  • Voice-message language resolution maps explicit auto/multi to multilingual and otherwise uses the user's supported single-language preference or multilingual fallback; no incident evidence implicated this branch.

Orchestrator conclusions

  1. Right: Transcribe Later was not the cause. Onboarding suspension is a no-op when batch mode is already off; restore only re-enables a mode for which the suspension marker was persisted, and startup repairs a stale marker.
  2. Partly right: the backend did return empty HTTP 200 SSE streams on EXPECTED_SILENCE, and production evidence shows a large silence cohort. Wrong as a cause: codec misclassification, language resolution, and a first-provider empty result did not explain this incident; the failing clips were truncated by the client and stopped at strict VAD before provider transcription.
  3. Right: production and test button handlers had diverged, several drops were debug-only or silent, _voiceSendInFlight could remain wedged across a hung stream/early playback exception, and the 15-second auto-end could turn the user's late stop tap into a new empty session.
  4. Right: mobile/default synthesis mapped to Aoede with an emotional style while desktop live voice uses Charon, and whole-preview versus fragmented live synthesis explains the remaining preview/prosody difference. Chunk-size work remains in the separate progressive-playback change.

Compatibility and rollout

  • The server uses the existing error: <json> SSE prefix already shipped for typed transcription failures. Current clients retain the error code; older clients either use their existing generic error path or ignore an unrecognized terminal chunk, so the change is additive and does not alter successful frames.
  • Backend behavior and TTS voice take effect after an independent backend deployment. The button-state, localized UI, timeout recovery, telemetry, and failure haptic require a mobile release.
  • Backend rollout is managed by the separate backend release workflow. No mobile or desktop app release is triggered; the app changes wait for a mobile release.

Verification

  • cd backend && BACKEND_UNIT_TEST_FILE_LIST="$PWD/../app/.local/backend-tests-pendant-ask.txt" bash test.sh — 94 passed (11 chat/quota router, 68 transcription-route, 15 TTS); 5 unrelated slow tests deselected by the repository marker.
  • cd backend && pytest -q tests/unit/test_app_client_schema_inventory.py — 12 passed.
  • cd app && flutter test test/providers/omi_button_actions_controller_test.dart test/providers/message_provider_voice_test.dart test/providers/message_provider_failed_reply_test.dart test/unit/voice_message_stream_error_test.dart test/services/voice_playback/omi_voice_playback_service_test.dart — 34 passed.
  • cd app && flutter analyze lib/backend/http/api/messages.dart lib/backend/schema/message.dart lib/coordinators/provider_capture_external_actions.dart lib/providers/message_provider.dart lib/services/capture/capture_controller.dart lib/services/capture/capture_external_actions.dart test/providers/omi_button_actions_controller_test.dart test/providers/message_provider_voice_test.dart test/unit/voice_message_stream_error_test.dart — no issues.
  • cd app && python3 scripts/l10n.py check — 49 locales, 3,428 keys; OK.
  • python3 scripts/check_event_registry.py — 136 registered events; generated output current.
  • git diff --check — passed.

Product invariants affected

None.

Line-Count-Exception: backend/routers/chat.py | 2242 -> 2250 | Emits the typed expected-silence terminal frame at the route's existing transcription-attempt boundary.

Failure-Class: FC-accepted-session-completes-silently-without-payload

🤖 Generated with Claude Code

@Git-on-my-level
Git-on-my-level force-pushed the fix/pendant-ask-silent-drop-and-voice branch from 173383b to 7dc06ac Compare September 27, 2026 13:11
@Git-on-my-level
Git-on-my-level force-pushed the fix/pendant-ask-silent-drop-and-voice branch from 7dc06ac to a28c985 Compare September 27, 2026 18:13
@Git-on-my-level
Git-on-my-level merged commit a83449a into main Sep 27, 2026
55 of 59 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/pendant-ask-silent-drop-and-voice branch September 27, 2026 18:42
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