Skip to content

fix(mobile): start dictation from agent chat tabs - #32105

Merged
nwparker merged 4 commits into
stablyai:mainfrom
pelted:chris/fix-mobile-dictation-agent-chat
Oct 24, 2026
Merged

nwparker merged 4 commits into
stablyai:mainfrom
pelted:chris/fix-mobile-dictation-agent-chat

Conversation

@pelted

@pelted pelted commented Oct 22, 2026 •

Copy link
Copy Markdown

ELI5

On the phone, tapping the microphone in an agent chat did nothing because the chat has no terminal handle. A connected agent chat can now start dictation and append the transcript to its draft. Terminal views continue to use their terminal input gate, and disabling desktop dictation still prevents capture.

Fixes #26003.

What changed

The dictation hook selects readiness for the visible composer: a connected host for native chat, or the existing canSend gate for terminal mode. It uses the existing capture, transcript routing, cancellation, and speech.dictation.* operations.

The original fix and commit by Chris Born (@pelted) are preserved. The follow-up replaces the initial test harness with checked consumed scope fields, real chat resolution, explicit start/finish replies, transcript-delivery assertions, and renderer teardown.

Verification

  • Reproduced against current main baseline 8d94ed06570a: the connected no-terminal agent-chat case failed with no speech.dictation.start request; disconnected/disabled/missing-handle/normal-terminal controls passed.
  • 84 focused tests pass across 13 suites: actual dictation start/finish delivery, disabled/disconnected gates, terminal routing, stale-start and late-transcript suppression after disconnect, reconnect, settings refresh, desktop refusals, and the web audio bridge.
  • The final 7-case regression suite passes again on committed follow-up head 04e1e5b1ca78 after review. Format and changed-code quality checks pass with zero new findings.
  • Independent adversarial review found no blocker.
  • Mobile verify CI passes on final head 04e1e5b1ca78, including full mobile typecheck, test-typecheck ratchet, tests, lint, and formatting. The fresh general PR Checks run also passes, including static/typecheck, standalone React Doctor, the app bundle/render checks, and the PR checks passed aggregate. Test LoC passes.
  • The follow-up corrects two test-only React Doctor findings by removing an unnecessary render-time ref assignment and using the preferred array type syntax. Production is unchanged.

Merge risk

Low source risk, with mobile integration limits. The production diff is one derived readiness value and its use by the existing hook; there are no RPC, permission, audio-engine, storage, or platform-branch changes. The existing cancellation and terminal gates remain in force.

This verification did not exercise a physical iPhone/iPad/Android microphone or speech model. The local checkout lacks Expo/React Native dependencies, so full mobile typechecking was validated by the passing Mobile verify CI run.

Visual proof

N/A: no layout change. The behavioral regression is demonstrated by the start/finish RPC and transcript-delivery tests. Native hardware capture is not claimed as verified.

AI disclosure

AI coding agents helped reproduce, review, and strengthen verification of the original contributor's fix.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer code or resources copied.

The mobile mic only started dictation when a terminal was active. An
agent chat tab has no terminal handle, so a tap there returned without
starting, opening setup, or showing an error.

A chat transcript goes to the chat composer, not a terminal, so chat
tabs now only need a connected desktop. Terminal tabs keep the
terminal input gate.

Fixes stablyai#26003
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bea20f1f-f50a-4f6b-abab-570807682aa8
📥 Commits

Reviewing files that changed from the base of the PR and between 1cf24e5 and cb3b163.

📒 Files selected for processing: 2
  • mobile/src/session/mobile-dictation-agent-chat-start.test.tsx
  • mobile/src/session/use-mobile-session-native-chat-dictation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The dictation hook now uses the connected state when native chat is visible. Otherwise, it uses terminal canSend. The settings-enabled requirement remains. New tests check that a connected agent-chat mic tap sends speech.dictation.start and a disconnected tap does not.

Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to cb3b1

The change appears ready to merge after normal checks; no actionable dictation risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: enabling dictation from mobile agent chat tabs.
Linked Issues check Passed The directly linked issue is #26003. It reports that mobile dictation appears to do nothing. The PR changes use-mobile-session-native-chat-dictation.ts so an agent chat with `connState === 'connecte…
Out of Scope Changes check Passed The PR changes one dictation gate and adds focused regression tests for the linked bug. The test covers the agent-chat case and the disconnected guard. Terminal tabs retain the canSend gate, and the…
Description check Passed The description follows the repository template closely: it has ELI5, What changed, Why-equivalent content, a linked issue (Fixes #26003), verification, merge risk, visual proof (N/A with reason), AI …
Full details: Linked Issues check

Explanation

The directly linked issue is #26003. It reports that mobile dictation appears to do nothing. The PR changes use-mobile-session-native-chat-dictation.ts so an agent chat with connState === 'connected' can start dictation without a terminal handle. The existing transcript route sends the result to the chat composer. The added test verifies that a connected agent chat sends speech.dictation.start and that a disconnected chat does not. No additional coding acceptance criteria appear in #26003.

Full details: Out of Scope Changes check

Explanation

The PR changes one dictation gate and adds focused regression tests for the linked bug. The test covers the agent-chat case and the disconnected guard. Terminal tabs retain the canSend gate, and the setting gate remains in place. The changes have a direct connection to #26003 and show no unrelated implementation.

Full details: Description check

Explanation

The description follows the repository template closely: it has ELI5, What changed, Why-equivalent content, a linked issue (Fixes #26003), verification, merge risk, visual proof (N/A with reason), AI disclosure, and the agent skill upstream boundary box checked. Gaps: the template's 'Why' section is not labeled and does not explain why this approach beats alternatives. The Testing checklist items ('I manually tested these changes locally' and 'Automated tests added/updated') are not ticked, and the description reports device testing was not done. The Checklist section is absent. Notes on security, cross-platform, SSH, backwards compatibility, and performance are not addressed explicitly. The description is substantive and specific, so it is mostly complete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 24431a2 into stablyai:main Oct 24, 2026
23 checks passed
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.

[Bug] Dictation on iPad?

2 participants