Skip to content

MS-26473 PDChat: wake phrase for Voice Mode, and demo controls for every voice option - #233

Merged
davidnmbond merged 2 commits into
mainfrom
feature/MS-26473-wake-phrase-demo
Oct 6, 2026
Merged

davidnmbond merged 2 commits into
mainfrom
feature/MS-26473-wake-phrase-demo

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Part of MS-26473.

What

  • Wake phrase. New IChatService.WakePhrases (default null, off) and IChatService.VoiceIdleTimeout (default 10 seconds), both default interface members backed by ChatServiceDefaultState. With wake phrases set, Listening with no word for the idle timeout moves to the new PDChatVoiceState.Dormant (appended, no renumbering). It never goes dormant while the text box has focus or an auto-send is pending. While dormant, words are not typed and pauses never send; a rolling buffer of normalised words (lowercase, letters and digits only) is matched against each phrase, so "HEY dumbbot," wakes it, and only the words after the phrase are typed. A host that reports only pauses can wake it from the turn text. The microphone keeps streaming while dormant, and the WakePhrases remarks tell hosts to make that clear to users.
  • Status line reads Waiting for "<first phrase>"…; the microphone button stays on, says it is waiting, and pressing it turns Voice off.
  • Demo. DumbChatService now has settable VoiceEndpoints, Agents, Models, WakePhrases, VoiceIdleTimeout, VoiceAutoSendDelay, IsReadAloudEnabled, SelectedAgentId and SelectedModelId, each raising OnConfigurationChanged. The PDChat page has a Voice and Assistant section for all of them, and the documentation describes the toolbar, read-aloud, models and wake phrase. The simulated microphone starts every other utterance with "Hey DumbBot," so the wake phrase can be demonstrated.

Verification

  • dotnet build PanoramicData.Blazor.Test -c Release: 0 errors, 0 warnings. PanoramicData.Blazor.Web also builds clean (apart from its existing not-packable notice).
  • Full suite via the test executable: 3757 passed, 0 failed (main baseline 3729; 28 new: PDChatTests.WakePhrase.cs and DumbChatServiceVoiceTests.cs). The PDChat and demo-service classes were rerun five times with no failure.
  • Demo started in Development on a local port: /pdchat renders the new section and the simulated voice module is served. The interactive wake in a real browser was not exercised.

🤖 Generated with Claude Code

…ry voice option

With IChatService.WakePhrases set, a microphone that hears no word for
VoiceIdleTimeout (default 10 seconds) goes Dormant: nothing is typed or sent
until a wake phrase is heard, matched ignoring case and punctuation, and only
the words after it are typed. It never goes dormant while the text box has
focus or a send is pending. PDChatVoiceState.Dormant is appended to the enum.

DumbChatService makes its voice endpoints, agents, models, wake phrases, idle
timeout, auto-send delay, read-aloud and selections settable, each raising
OnConfigurationChanged, and the PDChat demo page gains a Voice and Assistant
section to drive them. The simulated microphone starts every other utterance
with "Hey DumbBot," so the wake phrase can be seen working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 52 complexity · 0 duplication

Metric Results
Complexity 52
Duplication 0

View in Codacy

🟢 Coverage 95.04% diff coverage · -0.04% coverage variation

Metric Results
Coverage variation ✅ -0.04% coverage variation
Diff coverage ✅ 95.04% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7756e23) 15856 15843 99.92%
Head commit (3d13d99) 15970 (+114) 15951 (+108) 99.88% (-0.04%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#233) 121 115 95.04%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

…ent test data

The dormant helper waited for VoiceState only, so on a slower runner the
markup could still show the listening status when the test read it. It now
waits for the rendered dormant status. Adds the XML comment CI requires on
the public TheoryData member.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidnmbond
davidnmbond merged commit d262f9c into main Oct 6, 2026
8 checks passed
@davidnmbond
davidnmbond deleted the feature/MS-26473-wake-phrase-demo branch October 6, 2026 00:38
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.

1 participant