Skip to content

fix(app): complete pendant tutorial questions from request outcomes - #23466

Merged
aryanorastar merged 5 commits into
mainfrom
fix/pendant-tutorial-outcomes
Oct 25, 2026
Merged

aryanorastar merged 5 commits into
mainfrom
fix/pendant-tutorial-outcomes

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and behavior

The pendant tutorial's question step can wait forever even when the voice endpoint answered: it watches the main chat list, but pendant replies correctly stay out of an open past/persona/fresh chat. Unrelated AI messages can instead complete the step. Busy/quota, codec, file-save, transport, timeout and incomplete responses also lack a terminal tutorial outcome. No-speech handling can additionally wait indefinitely for a Bluetooth failure vibration.

Return this request's typed answer/failure through the existing MessageProvider → production external-actions adapter → capture → tutorial pipeline. The question/answer displays independently of chat selection, failures return to a localized press/retry prompt, and raw ignored/overlapping presses cannot invent a Listening session. Step/attempt guards reject results after exit/restart. The voice response stream has a total deadline so heartbeats cannot strand it. Best-effort failure vibration cannot block completion or retry.

Refs #23385. Keep the customer incident open for validation on the released app. Related diagnostic-only report: #23384; a shared customer does not establish a shared cause. Earlier tutorial fixes #20806, #21069 and #20805 are already on main; they do not cover these gaps. Their store release has not been independently verified here.

Review follow-up (2026-10-24)

  • The voice deadline no longer waits for upstream cleanup. _voiceReplyWithDeadline awaited StreamIterator.cancel in its finally. The production stream is an async-generator chain over the HTTP body, so with a stalled body the cancel waited for the next chunk, and the tutorial question stayed busy past its timeout. The deadline now completes an abort that sendVoiceMessageStreamServer passes into makeMultipartStreamingApiCall's existing abortable-request trigger. It settles immediately without awaiting the cancel and reads nothing the request produces afterwards.
  • Regressions in message_provider_voice_deadline_test.dart, using the real MessageProvider, sendVoiceMessageStreamServer and makeMultipartStreamingApiCall with a synthetic transport: a stalled body settles within the bound, the request's abort trigger fires, and late output is not shown (fails with the awaited cancel restored). Stalled headers also settle, and the next question is admitted rather than dropped as busy.
  • Evidence on c5849dbc52: the new deadline tests, the existing MessageProvider voice tests and the tutorial question flow pass (27 tests); analyzer ratchet passed. No simulator or hardware run for this change; no live provider.

Verification and risk

Current-head readiness checked 2026-10-25: required Mobile Release Eligibility and all applicable remote checks pass on c5849dbc527e5a47177d50814dfdc6043f284254. The historical wider local run and its Limitless timing failure are retained below for transparency; it is not claimed as a full-suite pass.

  • Targeted production-provider/widget flow with synthetic voice input: cd app && flutter test test/widgets/pendant_tutorial_question_flow_test.dart (main/past/persona/fresh chat; no speech; quota/busy; file/codec/network failure; incomplete/deadline; retry; unrelated traffic; stale response; auto-submit).
  • 49 targeted checks passed, including the tutorial provider/revisit/button-controller, voice-message suites and a held-Bluetooth-haptic recovery regression (97e8215a38).
  • iOS simulator functional flow verified on a dedicated iPhone 16 Pro / iOS 26.5 simulator through agent-flutter: press/listen/submit, own question+answer, Continue, no-speech, connection failure, retry and automatic submission. A reused native debug host (without its data container) loaded the current Dart fixture by Flutter attach/hot restart; this is software integration evidence, not fresh native binary certification, physical BLE or live-provider acceptance. Reproduce with flutter run --flavor dev -d <iOS-simulator> -t integration_test/pendant_tutorial_capture.dart then agent-flutter. The automated integration entrypoint is integration_test/pendant_tutorial_question_test.dart.
  • Analyzer ratchet passed; focused hermetic journeys passed 12/12; bounded pre-push/preflight and generated-output checks passed on 97e8215a38d1fe5124ef3e216410503fa6f1f0fe. The historical failure-class ratchet explicitly skipped for shallow history; full-history CI must enforce it. No check was bypassed.
  • The broader app run hit an unchanged Limitless wall-clock watchdog test (limitless_golden_test.dart:901); a focused rerun reproduced its missing late timer writes. Both test and production connector match pinned main exactly. The run was stopped at 4,628 passed / seven skipped / one failed after reproducing that failure; it is incomplete. This is disclosed, not waived or reported green. Exact-head remote CI subsequently passed, as recorded in the readiness update.

Normal application outcome/state handling: no native BLE, firmware, recording custody, backend endpoint or authentication contract changes. Fixtures supply synthetic button/audio/codec and voice responses; they do not establish real radio delivery or Andrea's exact cause. A real pendant/customer retest on the released build remains incident follow-up. Keep existing recordings and settings; no reinstall/reset/recovery mutation is part of the fix.

Remaining rollout after verification: merge and signed mobile app release. No backend deployment required.

Failure-Class: new

Product invariants affected

  • INV-CAP-1: voice-question result/admission handling does not change BLE subscription, WAL capture or durable audio custody. Existing live capture continues throughout the tutorial.

UI-Evidence: none -- Existing layout retained. Dedicated iOS simulator functional verification and local before/answer/failure screenshots were inspected; synthetic fixture and reproducible entrypoint are documented above. No public screenshot attachment is claimed.

View guided diff Turn on auto-fix

Maintainer readiness verification (2026-10-25)

  • Reviewed final source diff on c5849dbc527e5a47177d50814dfdc6043f284254; clean merge-tree against current main 225d7cef7a2eafdbab1c4bd25f81f945454d6d12.
  • Fresh targeted run: cd app && /opt/homebrew/share/flutter/bin/flutter test --no-pub --concurrency 1 --reporter expanded test/providers/message_provider_voice_deadline_test.dart test/providers/message_provider_voice_test.dart test/widgets/pendant_tutorial_question_flow_test.dart test/providers/omi_button_actions_controller_test.dart test/widgets/device_onboarding_question_revisit_test.dart — 44 tests passed, including stalled headers/body, abort, ignored late output and admission of the next question. Synthetic transport, no live provider or physical BLE claim.
  • Required Mobile Release Eligibility passes. At readiness, remote checks show 27 successful, 18 appropriately skipped, none pending/failing. Dart analysis/tests, seeded journeys, Android compile/JVM/emulator, hygiene and formatting succeeded. Skipped iOS compile is not represented as a fresh iOS build; reuse the documented simulator evidence for the unchanged tutorial flow.
  • No backend runtime source changes; main backend automatic-deploy scope is a no-op for this PR. No release workflow, store rollout or deployment is requested or dispatched. A signed mobile release and customer confirmation remain separate follow-up; bug: pendant tutorial question can stall outside the main chat or after voice failures #23385 is referenced, not automatically closed.

@Git-on-my-level

Copy link
Copy Markdown
Member

Verdict: the production change here is correct and nicely scoped — replacing chat-list watching with a typed per-request result is the right architecture for this bug, and I found no blocking issues.

Verified on 97e8215:

  • app/lib/models/voice_question_result.dart — minimal typed outcome; every terminal path maps to answered/noSpeech/busy/quota/unavailable.
  • app/lib/services/capture/capture_voice_questions.dart — new part file owns the submit path: submission-generation + attempt + device-revision guards reject stale callbacks, codec lookup bounded to 10s, and the failure haptic is unawaited with catchError so a stalled BLE write can't strand the tutorial — matches the last commit's stated intent.
  • app/lib/providers/message_provider.dart — sendVoiceMessageStreamToServer returns VoiceQuestionResult on all terminals (quota/busy/empty/save-failure/incomplete stream); _voiceReplyWithDeadline gives the response stream a total 60s deadline so think/data heartbeats can't extend it, and the finally cancels the iterator (closing the HTTP stream).
  • app/lib/providers/device_onboarding_provider.dart — _questionAttempt++ on every step transition/exit/restart plus acceptsQuestionResult gating means late answers can't complete a different attempt.
  • single_press_step.dart — net −38 lines: the MessageProvider listener that inferred completion from chat-list growth is gone; the step observes tutorial state directly. This removes both the stuck-when-another-chat-is-open and unrelated-AI-message-completes-the-step modes from bug: pendant tutorial question can stall outside the main chat or after voice failures #23385.
  • capture_controller.dart — only admitted capture transitions move the question UI now; a pre-tutorial voice session is cancelled rather than adopted.
  • app/docs/pendant-tutorial-question.md — the 10s codec bound, 60s reply budget, and 15s auto-submit all match the code.
  • Coverage: pendant_tutorial_question_flow_test.dart has 8 scenarios including unrelated-traffic, late-answer-after-restart, pending-haptic retry, and auto-submit.

Blast radius: pendant tutorial question step only; other chat send paths gain return values without behavior change. No new requests or cost.

USER IMPACT: the pendant onboarding "ask a question" step no longer gets stuck forever when another chat is open or the request fails — it now always ends with either the answer or a retry prompt.

Still want, for when this leaves draft: (1) confirm the pre-existing Limitless timing failure you hit in the wider run is tracked separately so it can't mask regressions here; (2) one real-device pass over the BLE paths (codec timeout, failure haptic) since tests use synthetic streams.

Given it reshapes onboarding completion UX, leaving the final call for a human maintainer once it's ready.


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 Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution flutter flutter work labels Oct 24, 2026
… waiting

The total voice-reply deadline awaited StreamIterator.cancel, which waits for
the async-generator HTTP chain to reach its next chunk, so a stalled body kept
the tutorial question pending past its timeout. The deadline now aborts the
in-flight request through the existing abortable multipart trigger, settles
immediately, and reads nothing the request produces afterwards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

Pushed c5849dbc52, which fixes the stalled-deadline finding.

The total voice-reply deadline awaited StreamIterator.cancel. The production stream is an async-generator chain over the HTTP body, so when the body stalled, the cancel waited for the next chunk and the tutorial question stayed busy past its timeout. The deadline now aborts the in-flight request through the existing abortable multipart trigger, which is passed from sendVoiceMessageStreamServer into makeMultipartStreamingApiCall. It settles immediately without waiting on cleanup, and nothing the request produces afterwards is read.

Tests:

  • New message_provider_voice_deadline_test.dart runs the real provider and streaming call over a synthetic transport.
  • Stalled body: the deadline settles in time, the request's abort trigger fires, and late output is never shown. This test fails if the awaited cancel is restored.
  • Stalled headers: the deadline also settles, and the next question is admitted rather than rejected as busy.
  • Existing voice and tutorial tests: 27 passed. Analyzer ratchet and preflight (25 checks) passed.

No simulator or hardware run for this change.

@aryanorastar
aryanorastar marked this pull request as ready for review October 25, 2026 05:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T05:41:04.492870Z c5849db Draft marked ready
ℹ️ 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.

@aryanorastar
aryanorastar merged commit 5fb53c0 into main Oct 25, 2026
50 checks passed
@aryanorastar
aryanorastar deleted the fix/pendant-tutorial-outcomes branch October 25, 2026 05:40
aryanorastar added a commit that referenced this pull request Oct 26, 2026
The pendant tutorial can remain on Processing with spoken replies
enabled after #23466: native playback setup was awaited before starting
the voice-stream deadline, and failed replies awaited native audio
cleanup before releasing the voice busy guard.

Bound spoken-output admission with the existing voice-reply budget and
revoke late admission after failure. Finish failed questions
independently of best-effort, request-scoped cleanup, using a unique
playback identity. Cleanup follows the admitted playback lifecycle: a
skipped mode-off, missing-headphone or revoked-admission attempt owns no
new playback and must leave existing cleanup intact. An actually
admitted replacement retires old cleanup after asynchronous boundaries.

Refs #23385 and merged #23466. This builds on the merged outcome
pipeline rather than reapplying #23391. Preserve recordings, WAL
custody, settings, firmware and backend contracts. No backend deployment
is needed. Keep the customer incident open until a mobile release
contains the complete fix and the reporter confirms question → answer →
Continue and retry.

## Review correction

The initial head `385422f01a` incorrectly guarded cleanup with
`_beginAttemptSeq`, which advances even when playback is skipped. The
three review regressions pass on baseline and fail on that head. The
revisions through `d87ea9ea8ee1467160fa3493f91115a64d7725d1` use the
existing `_lifecycleToken` as cleanup ownership in both `interrupt` and
an admitted begin that is clearing prior audio. Six committed
regressions cover all three skips at each cleanup entry point. The
existing admitted-replacement regression is preserved unchanged. Earlier
green CI/no-blocker notes for `385422f01a` do not certify this revision.

## Verification

- Reproduced all three review cases against baseline and the initial PR
head: baseline 3/3 pass, initial head 0/3 pass. After the interruption
correction, all six baseline/current comparisons pass alongside the
committed service suite (27 tests total). The sibling admitted-begin
cleanup cases also fail on `0cedebcf1b` before that path is corrected
and now pass in the final focused suite.
- Revised head `d87ea9ea8ee1467160fa3493f91115a64d7725d1`: 105 targeted
provider, tutorial/widget and voice-playback tests pass. The production
service, capture → external-actions → MessageProvider → tutorial owners
execute with synthetic native/audio/provider I/O. No physical pendant or
live-provider acceptance claim.
- Final head `d87ea9ea8ee1467160fa3493f91115a64d7725d1`: analyzer
ratchet and bounded pre-push passed, including 27 selected
manifest/preflight checks. The local 90-day historical guard explicitly
skipped in the shallow clone; full-history CI must enforce it. The
affected tutorial integration flow was rerun successfully on the
dedicated iPhone 16 Pro/iOS26.5 simulator via attach/hot restart and
driver. Reused native debug host with current Dart and synthetic
native/audio/provider I/O; no fresh native binary, physical BLE or
live-provider claim. Current-head CI and maintainer re-review remain
required; keep draft.
- Previous head's remote CI passed 7,420 Flutter tests/four skipped and
Hygiene/full-history guard. Those results remain historical and must not
be reported as current-head CI.
- At the implementation-time release check on 2026-10-25, original
#23466 was in iOS 1.0.576 (1474), submitted for Apple review. This
follow-up is absent from that binary; merging and a later signed mobile
release remain separate from code verification.

## Product invariants affected

- INV-CAP-1: only pendant question response/playback completion changes;
BLE ingress, WAL custody, saved recordings and transcription settings
are preserved.

Failure-Class: new

Line-Count-Exception: app/lib/providers/message_provider.dart | 1203 ->
1208 | keeps request-local playback authorization, unique ownership and
best-effort cleanup beside the existing voice-stream result/finally
guard without another global owner or capture pipeline.

UI-Evidence: none -- layout is unchanged; the existing tutorial UI is
exercised through the production-owner simulator fixture documented in
app/docs/pendant-tutorial-question.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants