Skip to content

feat: add wake phrase hot keyword support#761

Open
Swetha-160303 wants to merge 1 commit into
juspay:releasefrom
Swetha-160303:feat/wake-phrase-hot-keyword
Open

feat: add wake phrase hot keyword support#761
Swetha-160303 wants to merge 1 commit into
juspay:releasefrom
Swetha-160303:feat/wake-phrase-hot-keyword

Conversation

@Swetha-160303
Copy link
Copy Markdown

@Swetha-160303 Swetha-160303 commented May 13, 2026

Summary by CodeRabbit

New Features

  • Added optional wake-phrase detection for voice agent interactions. Users can now configure custom wake phrases, timeout settings, and single-activation behavior to control when the bot responds to voice input.

Review Change Stack

Copilot AI review requested due to automatic review settings May 13, 2026 09:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f337256-e05e-4a38-be35-f2665221377b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Wake-phrase gating is introduced to the Breeze Buddy voice agent. A new WakePhraseConfig schema model defines enabled flag, trigger phrases, timeout, and single-activation behavior. This configuration is added as an optional field to ConfigurationModel, then wired into the pipeline's turn start strategies when enabled.

Changes

Wake Phrase Gating for Voice Agent

Layer / File(s) Summary
Wake phrase configuration schema
app/ai/voice/agents/breeze_buddy/template/types.py
WakePhraseConfig Pydantic model defines enabled, phrases, timeout, and single_activation fields; ConfigurationModel gains optional wake_phrase field.
Pipeline strategy integration
app/ai/voice/agents/breeze_buddy/agent/pipeline.py
WakePhraseUserTurnStartStrategy is imported and conditionally prepended to start_strategies in build_pipeline when wake-phrase is enabled and phrases are configured; configuration state is logged.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 A whispered wake phrase now guards the breeze—
Sweet agent awakens only when it please!
Phrases configured, timeouts tamed with care,
No more sleepy responses mid-air!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature addition: wake phrase hot keyword support is implemented through the new WakePhraseConfig model and conditional pipeline strategy integration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/ai/voice/agents/breeze_buddy/template/types.py`:
- Around line 417-422: WakePhraseConfig allows blank phrases and non-positive
timeout when enabled, causing invalid runtime configs; add Pydantic validators
on WakePhraseConfig (use `@root_validator` or field validators) so that when
enabled is True: (1) phrases is a non-empty list and each entry is a non-blank
string (strip and reject ""), and (2) timeout is > 0 (reject <= 0); raise clear
ValueError messages indicating which field is invalid so invalid configs fail at
schema validation instead of at runtime.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5cd6970d-1c8f-4668-b661-08db92c3dbe2

📥 Commits

Reviewing files that changed from the base of the PR and between 0689666 and 6a41eff.

📒 Files selected for processing (2)
  • app/ai/voice/agents/breeze_buddy/agent/pipeline.py
  • app/ai/voice/agents/breeze_buddy/template/types.py

Comment on lines +417 to +422
enabled: bool = False
phrases: List[str] = Field(default_factory=list)
timeout: float = Field(10.0, description="Seconds to stay awake after phrase.")
single_activation: bool = Field(
False, description="Require phrase before every turn (not just once)."
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate wake-phrase inputs at schema boundary.

WakePhraseConfig currently permits blank phrases and negative timeout. When enabled=True, this can produce hard-to-debug no-op/invalid configs that are only discovered at runtime.

Suggested fix
 class WakePhraseConfig(BaseModel):
@@
     enabled: bool = False
     phrases: List[str] = Field(default_factory=list)
-    timeout: float = Field(10.0, description="Seconds to stay awake after phrase.")
+    timeout: float = Field(
+        10.0, ge=0.0, description="Seconds to stay awake after phrase."
+    )
     single_activation: bool = Field(
         False, description="Require phrase before every turn (not just once)."
     )
+
+    `@model_validator`(mode="after")
+    def _validate_wake_phrase(self) -> "WakePhraseConfig":
+        self.phrases = [p.strip() for p in self.phrases if p and p.strip()]
+        if self.enabled and not self.phrases:
+            raise ValueError(
+                "wake_phrase.phrases must include at least one non-empty phrase when enabled=true"
+            )
+        return self
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/ai/voice/agents/breeze_buddy/template/types.py` around lines 417 - 422,
WakePhraseConfig allows blank phrases and non-positive timeout when enabled,
causing invalid runtime configs; add Pydantic validators on WakePhraseConfig
(use `@root_validator` or field validators) so that when enabled is True: (1)
phrases is a non-empty list and each entry is a non-blank string (strip and
reject ""), and (2) timeout is > 0 (reject <= 0); raise clear ValueError
messages indicating which field is invalid so invalid configs fail at schema
validation instead of at runtime.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional “wake phrase” gating to the Breeze Buddy voice agent so the bot only starts responding after a configured trigger phrase is heard, via Pipecat’s WakePhraseUserTurnStartStrategy.

Changes:

  • Introduces WakePhraseConfig and exposes it as configurations.wake_phrase in the template configuration schema.
  • Prepends WakePhraseUserTurnStartStrategy to the user turn start strategy chain when wake-phrase gating is enabled and configured.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
app/ai/voice/agents/breeze_buddy/template/types.py Adds WakePhraseConfig and a new wake_phrase field on ConfigurationModel to support template-level configuration.
app/ai/voice/agents/breeze_buddy/agent/pipeline.py Wires the wake phrase config into pipeline construction by adding WakePhraseUserTurnStartStrategy ahead of other start strategies.


enabled: bool = False
phrases: List[str] = Field(default_factory=list)
timeout: float = Field(10.0, description="Seconds to stay awake after phrase.")
phrases: List[str] = Field(default_factory=list)
timeout: float = Field(10.0, description="Seconds to stay awake after phrase.")
single_activation: bool = Field(
False, description="Require phrase before every turn (not just once)."
Comment on lines +359 to +366
# Wake phrase: prepended first so it gates all subsequent strategies.
wake_cfg = getattr(configurations, "wake_phrase", None)
if wake_cfg and wake_cfg.enabled and wake_cfg.phrases:
start_strategies.append(
WakePhraseUserTurnStartStrategy(
phrases=wake_cfg.phrases,
timeout=wake_cfg.timeout,
single_activation=wake_cfg.single_activation,
@Swetha-160303 Swetha-160303 force-pushed the feat/wake-phrase-hot-keyword branch from 6a41eff to f21f209 Compare May 13, 2026 10:49
@Swetha-160303 Swetha-160303 force-pushed the feat/wake-phrase-hot-keyword branch from f21f209 to 65d940d Compare May 13, 2026 10:51
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.

3 participants