Repository navigation
fix(onboarding): recover guided voice answers and show a grounded payoff - #21401
Conversation
Failure-Class: FC-guided-intro-transcription-has-no-answer-path Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: FC-guided-intro-transcription-has-no-answer-path Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: FC-guided-intro-transcription-has-no-answer-path Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: FC-guided-intro-transcription-has-no-answer-path Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: FC-guided-intro-transcription-has-no-answer-path Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: FC-guided-intro-transcription-has-no-answer-path 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: d2b47b1cc8
ℹ️ 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".
| _local = Platform.isIOS && await OnDeviceAppleProvider.isOnDeviceAvailable(_language); | ||
| return _local || await guidedVoicePreflight(); |
There was a problem hiding this comment.
Probe the STT path actually used for transcription
When the streaming provider circuit is cooling down but prerecorded STT remains healthy, this returns false and blocks recording for every device without local iOS transcription. The probed endpoint explicitly reports STT_SERVICE_MODELS streaming availability (backend/routers/speech_profile.py:67-74), while transcribeGuidedAnswer posts to the prerecorded endpoint, whose provider is selected from STT_PRERECORDED_MODEL (backend/utils/stt/pre_recorded.py:111-118); these services can fail independently. Use a readiness signal for /v2/voice-message/transcribe, rather than the streaming speech-profile probe.
Useful? React with 👍 / 👎.
| "moreOptions": "المزيد من الخيارات", | ||
| "filterByDate": "تصفية حسب التاريخ", | ||
| "memoryGraph": "الرسم البياني للذكريات", | ||
| "guidedVoiceExperience": "{part, select, unavailable{Voice transcription is unavailable right now. Type your answer instead.} type{Type Your Answer Instead} typing{Your answer} heard{Here's what I heard} transcribing{Got it, transcribing…} confirm{Use This Answer} answer{Save Answer} retry{Try Speaking Again} title{Here's what I'll remember} question{What should I focus on this week?} fallback{Based on what you shared} thinking{Thinking about your answers…} failed{We couldn't transcribe that answer. You can type it instead or try speaking again.} engine{The microphone couldn't start. Try again or type your answer instead.} other{}}", |
There was a problem hiding this comment.
Translate the new onboarding selector for each locale
The new selector is copied verbatim in English into the Arabic locale, as well as every other changed non-English ARB, so users in those locales see the new transcription recovery and payoff flow switch to English. Supply locale-specific translations through the repository's localization tool instead of duplicating the English template.
AGENTS.md reference: app/AGENTS.md:L118-L120
Useful? React with 👍 / 👎.
| transcript = text; | ||
| stage = IntroductionStage.confirmation; | ||
| _emit(); |
There was a problem hiding this comment.
Migrate the retained onboarding test to confirmation
Introducing this intermediate confirmation state leaves app/test/widgets/onboarding_resume_and_voice_retention_test.dart's _answerAll helper unmigrated: it calls next() four times without confirmAnswer(), so promptIndex never advances past zero and both retention/idempotency tests expecting four answers fail in the full Flutter test suite. Update that in-tree caller alongside the state-machine contract change.
AGENTS.md reference: AGENTS.md:L34-L34
Useful? React with 👍 / 👎.
| ); | ||
| answer.keep = answer.text.isNotEmpty; | ||
| answers.add(answer); | ||
| _recordCompletedPrompt(result: 'answered', transcriptPresent: true); |
There was a problem hiding this comment.
Mark typed answers as having no transcript
When a user chooses typing—either initially or after transcription fails—submitTyped() reaches this shared method with empty audio, but the completion event still records transcript_present: true. This makes typed recovery look like successful transcription in the guided-intro funnel and obscures whether the new fallback is actually needed or working; pass the answer source into this method and emit false for typed submissions.
Useful? React with 👍 / 👎.
| error = null; | ||
| try { | ||
| if (!voiceSaved) await _saveVoice(); | ||
| if (!voiceSaved && answers.any((a) => a.audio.isNotEmpty)) await _saveVoice(); |
There was a problem hiding this comment.
Report typed-only saves as not attempting voice enrollment
For a typed-only introduction this new predicate correctly skips _saveVoice(), but the Guided Intro Save Submitted event emitted just above still sets voice_attempted to !voiceSaved, which is true for every such user. The save funnel therefore records a voice attempt even though io.enroll was never called; derive that property from the same nonempty-audio condition used here.
Useful? React with 👍 / 👎.
| return [ | ||
| _button(copy('start'), _stoppingCapture ? null : () => unawaited(_start()), 'speech_profile_start'), | ||
| const SizedBox(height: OmiSpacing.xs), | ||
| _textAction(context.l10n.guidedVoiceExperience('type'), () => unawaited(flow.typeInstead()), 'introduction_type'), |
There was a problem hiding this comment.
Hide typing during voice-quality sample recovery
After enrollment reports a short sample, addSample() returns to the ready state specifically to collect additional audio, but this unconditional action lets the user type instead. Submitting that text adds an answer with empty audio, so the next Save and Finish retries the unchanged short recording and returns to the same error; typing cannot satisfy this recovery step. Suppress the typing action while _extraSample is active or route typed submission past voice enrollment.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Preserve paused PCM and corrected transcript enrollment audio, keep every voice control in the safe-area footer, and simplify the fallback payoff. Allow slow preflight checks and emit accurate accepted-chat and payoff telemetry, with controller/request/widget tests and real-font renders. Failure-Class: FC-guided-intro-transcription-has-no-answer-path Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep the retention and goal idempotency assertions while exercising the explicit heard-you confirmation introduced by this flow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
First-run voice-intro starters answer zero prompts on iOS 33% / Android 50%; about 20% encounter a transcription failure and 28% of Android / 23% of iOS starters skip without recording. Android has no live transcript during its WAV upload path. This change gives each prompt visible input feedback and a recoverable answer path, then shows what was saved and a first grounded chat answer.
Validation: 73 focused controller, request, widget and analytics tests plus five existing onboarding-header and four resume/retention regressions; 20 light-theme render tests (ten states each on iOS and Android at 393×852 @3x, real fonts); focused flutter analyze; mobile UX/l10n/event registry gates; make preflight. All I/O is synthetic in tests. This does not claim physical-device, live-provider or production-write acceptance. The voice guide also names
test/providers/speech_profile_provider_test.dart, which is absent on main; the current controller/IO tests and existing header suite were run instead.Screenshots are tracked in
.agent-artifacts/ui-evidence/onb-m-voice/withevidence.json. iOS 001–009 plus 019 and Android 010–018 plus 020 cover idle, recording, transcribing, confirmation, failed + typing offer, typing, review, chat payoff and fallback payoff, plus genuine paused recording. Recording PCM varies in amplitude. All PNGs were opened and visually checked. These “chat” screenshots use a synthetic completed API answer.Review regression layers:
Reviewer risks:
Invariants: INV-UI-1, INV-UI-3 (shared neutral controls, localized accessible copy, scrollable receipt).
Failure-Class: new
🤖 Generated with Claude Code