Repository navigation
feat(voice): voice mode can be switched off while dictation stays - #302
Merged
Merged
Conversation
Settings → Defaults → Voice mode has a Voice conversations switch, on by default so current setups do not change. Off, the chat no longer offers voice mode: its button and the Alt+V shortcut are gone, and dictation stays as it is. The switch is core's, so it holds whatever voice mode listens and speaks through: the Voice service or Voice servers. While it is off the portal refuses to take a voice session's lease and to speak a reply (409), and still takes a lease back. Voice mode that is on ends at once in the tab where it was switched off, and in another tab when its next lease renewal is refused. Transcription is untouched, so dictation keeps working. voiceSpeaks() is false, so the rule for spoken replies is no longer put in every conversation, only in one that has had a spoken message. The upgrade's voice hand-off from schema 8 keeps the new key with the other voice mode settings. Closes #287 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 14
✨ Finishing Touches
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. Comment |
…it can be used again A tab reloaded while voice mode was on there brings it back. When voice mode could not be used at that load (voice conversations switched off in another tab, or no source), it was ended, but the tab still meant to bring it back: the next time it could be used, as when Settings is closed after voice conversations are switched on again, voice mode started with the microphone and no click. Ended that way, it is now forgotten, as after any other end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion points to it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was asked
Issue #287 asks for a way to turn voice mode off and keep dictation only, for people who just want speech typed into the message box without a spoken conversation.
The change
Settings → Defaults → Voice mode has a new Voice conversations switch. It is on by default, so current setups do not change. The switch lives in core, so it works the same whatever voice mode listens and speaks through (the Voice service or Voice servers).
When it is off:
voiceSpeaks()returns false, so the rule for spoken replies is no longer added to every conversation. It is only there for conversations that have had a spoken message, as it already was with a source that cannot speak.A chat already in voice mode when the switch goes off: in the tab where the setting was changed, voice mode ends at once and gives its lease back (the page already re-reads the settings on
voice-config-changed). In any other tab, voice mode ends with the server's message at its next lease renewal (every 25 seconds), and replies before then are not spoken.A tab reloaded while voice mode was on there, with the switch off by then: voice mode is not brought back, and it does not come back later either. Before, the tab kept meaning to bring it back, so once the switch was on again, closing Settings in that tab (which re-reads the voice settings) started voice mode with the microphone and no click. This also happened on main after Stop using and choosing a source again. Now it is forgotten, as after any other end.
GET /api/voicenow includesconversation, andPUT /api/voiceaccepts it astrueorfalse. If a save leaves it out, it counts astrue, the same way the section's other settings fall back to their defaults. The upgrade's voice hand-off from schema 8 now keeps this key along with the other voice-mode settings. Docs updated:docs/guide/voice.md(the switch in Voice mode's settings, and Dictation points to it),docs/guide/settings.md(the Voice mode section's list) anddocs/reference/api.md. German strings added.What it does not do
/voice/transcribewithout?purpose=dictation) or prompts sent withvoice: true. Voice mode cannot start without a lease, and a tab that was already on ends at its next renewal.Tests
core/server/test/voice-providers.test.mjs: new test. On by default when nothing is saved. Switching off saves it andGETshows it.voiceSpeaks()is false and anAudioRulebuilt on it leaves a conversation with no spoken message. Lease and speech are refused with 409, a lease is still given back and the source hears it. Dictation transcription works. A non-boolean is refused with 400. Switching back on restores everything.tests/voice.test.mts:validateConfigdefaultsconversationto true and refuses non-booleans.core/server/test/schema-fingerprint.test.mjs: expectations updated for the saved key.tests/browser/voice.spec.mts: new spec. Voice mode that is on ends and gives back its lease when the switch goes off. The voice-mode button is gone and the dictation button stays. Alt+V, from the page or the message box, starts nothing and takes no lease. Dictation still listens. Switching back on brings the button back. A second new spec: a tab loaded with voice mode to bring back while the switch is off clears it, and switching on afterwards (as closing Settings tells the page) takes no lease and starts nothing.tests/browser/voice-mode.spec.mts: new spec for the switch (saved as clicked, hides the speaking-only sections, kept across a reload). The existing save bodies now includeconversation, and the recognition-only case checks that the switch is hidden.conversationcheck fromvoiceSpeaks, the lease refusal, or the speech refusal. Refusing lease releases too. Skipping the type check. Leavingconversationout ofGET. Defaulting a save to off. Treating an absent value as off. Ignoring it inVoiceControl. Not forgetting voice mode to bring back after a reload when it cannot be used (the reload spec above fails: voice mode starts). Not hiding the speaking-only sections. Not saving it. Showing the switch for a recognition-only source.core/serverandcore/webbuilds,npm run check:boundaries,core/webtypecheck,npm run docs:build(no dead links),voice-providers+schema-fingerprint(50/50), root voice/dictation/hands-free/i18n/settings-search/voice-first tests (142/142), voice and voice-servers extension tests (45/45), browser specsvoice,voice-modeandvoice-reload(39/39, rerun after the reload fix),voice-source,voice-interaction,voice-windows,settings,shortcuts,language,load-failuresand the voice extensions' specs.extension-hooks.spec.mts:25is flaky when the whole file runs (it fails the same way on main), and the 10 server tests in sandbox/folder/link files that fail on this Mac also fail on main.Closes #287
🤖 Generated with Claude Code
Summary by CodeRabbit