Skip to content

fix(onboarding): advance pendant tutorial on voice question timeout (#20786) - #20910

Closed
Aj2280 wants to merge 1 commit into
BasedHardware:mainfrom
Aj2280:fix/pendant-tutorial-voice-command-timeout
Closed

Aj2280 wants to merge 1 commit into
BasedHardware:mainfrom
Aj2280:fix/pendant-tutorial-voice-command-timeout

Conversation

@Aj2280

@Aj2280 Aj2280 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #20786.

In the pendant tutorial's "Ask Omi a Question" step (SinglePressStep), if a user presses the pendant button once, speaks, and does not press again, the capture service's 15 s timeout automatically ends and submits the question stream to the backend. Previously, DeviceOnboardingProvider only transitioned to questionSent = true upon a second button press, and SinglePressStep._onMessagesChanged() discarded new messages while questionSent was false. Consequently, the step remained stuck on "Listening…" indefinitely even after the question was answered in chat.

Fix

  1. DeviceOnboardingProvider Auto-Submit Recovery:
    • Added onQuestionSubmitted() which marks voiceSessionActive = false and questionSent = true.
    • Started a 15 s safety timer on voice session activation (_startAutoSubmitTimer()) mirroring the capture auto-submit timeout.
    • Guarded and cleared the timer on second button press, answer arrival, onboarding reset, completion, and disposal.
    • Updated onVoiceResponseReceived to ensure active sessions resolve cleanly when answers arrive.
  2. SinglePressStep Active-Session Message Handling:
    • In _onMessagesChanged(), if new messages arrive while provider.voiceSessionActive is true, immediately calls provider.onQuestionSubmitted() so the step processes the question and received answer rather than ignoring them.
  3. Unit Tests:
    • Added unit test suite in app/test/providers/device_onboarding_provider_test.dart verifying button state transitions, onQuestionSubmitted() state transitions, response arrival, and timer cancellation on reset.
  4. Mobile Changelog:
    • Added mobile changelog fragment in app/changelog/unreleased/20261007-pendant-tutorial-timeout-question.json.

Product Invariants

none

Failure Class

Failure-Class: none
UI-Evidence: none -- state recovery and timeout handling in onboarding step without new visual layout changes

Verification

  • Ran unit tests in app/test/providers/device_onboarding_provider_test.dart.
  • Formatted via dart format --line-length 120.
  • Ran make preflight.

Bounty Proposal

View guided diff

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @Aj2280 - clean, well-scoped fix for #20786, with the right recovery design and real unit tests. File-by-file:

  • app/lib/providers/device_onboarding_provider.dart - The new onQuestionSubmitted() has a proper idempotency guard (!voiceSessionActive && questionSent returns early), and the _autoSubmitTimer lifecycle is fully covered: cancelled on second press in _handleStep1Button(), on answer arrival in onVoiceResponseReceived(), in _resetOnboardingState(), completeOnboarding(), and dispose(). I found no leak or double-fire path.
  • app/lib/pages/onboarding/interactive_device_onboarding/steps/single_press_step.dart - Having _onMessagesChanged() call onQuestionSubmitted() when messages arrive during an active voice session is the right primary recovery path; it means the step advances even if the local timer's timing drifts from the capture service's. Good defensive layering with the timer as backstop.
  • app/test/providers/device_onboarding_provider_test.dart - Deterministic unit tests covering button state transitions, timeout submission, response arrival, and reset cancellation of the active session; tearDown dispose also cancels pending timers. Solid.
  • app/changelog/unreleased/20261007-pendant-tutorial-timeout-question.json - Matches the existing unreleased-fragment convention.

Two non-blocking notes:

  1. The 15s timeout is now duplicated between this provider and the capture service. If either changes, they can drift. Consider extracting a shared constant (or deriving the recovery purely from message arrival) in a follow-up.
  2. Edge case worth a quick think: if the user presses once and stays silent, the local timer still flips questionSent at 15s and the step shows "Processing…" with no Continue until an AI message arrives. That is a narrower stuck state than before, but if capture discards empty sessions rather than submitting, the step could still hang. Not blocking; flagging for awareness.

Nice work - this resolves the reported bug directly. Feedback generated by AI on behalf of the maintainer team.

@Git-on-my-level Git-on-my-level added flutter flutter work positive-signal Automation verified a genuine fix/quality contribution labels Oct 7, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @Aj2280 — verified this fixes the stuck "Listening…" path from #20786. Reviewed file by file:

  • device_onboarding_provider.dart: the new 15s _autoSubmitTimer mirrors the capture auto-submit timeout, and its lifecycle is fully covered (second press, response arrival, reset, complete, dispose). onQuestionSubmitted() guards double-transitions correctly, and onVoiceResponseReceived now clears session state so late answers resolve cleanly.
  • single_press_step.dart: calling onQuestionSubmitted() when messages arrive while voiceSessionActive is the key recovery path — without it, already-delivered messages would still be discarded. Ordering relative to the _messageCountAtStart slice is correct.
  • device_onboarding_provider_test.dart: good state-transition coverage for the new behavior.
  • Changelog fragment follows the existing unreleased convention.

Two non-blocking notes:

  1. The 15s constant mirrors the capture timeout rather than deriving from it — fine for now, just something to keep in sync if capture timing ever changes.
  2. CI skipped Dart Analyze & Tests on this diff (path filter), so the new test suite hasn't run in CI yet — worth a local run or a workflow-trigger tweak before merge.

Nice, tight fix. This feedback is AI-generated on behalf of the maintainers.


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

Copy link
Copy Markdown
Member

Thanks for the tutorial-timeout fix. The same behavior landed in #20806, which is now merged. Closing this as a duplicate.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @Aj2280 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

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.

Pendant tutorial: a question sent by the 15 s timeout leaves "Ask Omi a Question" on Listening forever

2 participants