Skip to content

fix(voice): show realtime voice mode toggle by default in all builds - #5441

Merged
M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
YellowSnnowmann:fix/voice-mode-flag-default-on
Aug 7, 2026
Merged

fix(voice): show realtime voice mode toggle by default in all builds#5441
M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
YellowSnnowmann:fix/voice-mode-flag-default-on

Conversation

@YellowSnnowmann

@YellowSnnowmann YellowSnnowmann commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Show the realtime ElevenLabs voice-mode toggle (Settings → Voice) by default in every build — local, staging, and production.
  • Flip VOICE_MODE_FLAG_ENABLED from opt-in (Boolean(VITE_VOICE_MODE)) to default-on with a kill switch (VITE_VOICE_MODE=false), matching the CHAT_ATTACHMENTS_ENABLED / DERIVED_TRANSCRIPT_ENABLED idiom in the same file.
  • Document the VITE_VOICE_MODE kill switch in app/.env.example.

Problem

The realtime voice mode section (#5399) was gated on VOICE_MODE_FLAG_ENABLED, which resolves to Boolean(import.meta.env.VITE_VOICE_MODE) — a build-time Vite env var. VITE_VOICE_MODE is not injected anywhere in the build pipeline: it is absent from the VITE_* env block in .github/workflows/build-desktop.yml (the single injection point both release-staging.yml and release-production.yml reuse), and from every .env file. It therefore baked in as false in every shipped bundle, so the toggle never rendered in local, staging, or production — only in unit tests that mock the flag on. Wiring the backend relay flags (the ElevenLabs Voice Agent identity-token / keepalive fixes) has no effect on this UI gate, since it is a compile-time import.meta.env constant.

Solution

  • app/src/utils/config.ts: VOICE_MODE_FLAG_ENABLED = (…VITE_VOICE_MODE…)?.trim() !== 'false'. Undefined (the shipped case) → on; explicit VITE_VOICE_MODE=false → off. No CI/env wiring required, so the toggle appears in all three build environments by default.
  • The realtime code paths still additionally gate on the persisted mascot.voiceMode (HumanPage.tsx), so the feature ships dark until the user flips the now-visible toggle — no behaviour change for users who do not opt in.
  • app/.env.example: documented the kill switch next to the sibling VITE_CHAT_ATTACHMENTS entry.
  • Validation: pnpm typecheck clean; focused suites HumanPage.realtimeMode.test.tsx + RealtimeVoiceControls.test.tsx pass (9/9).

Submission Checklist

  • N/A — behaviour-only default flip of an existing, already-tested flag; the visible/hidden gate is covered by HumanPage.realtimeMode.test.tsx and RealtimeVoiceControls.test.tsx. No new branch to cover. The global test mock (app/src/test/setup.ts) intentionally keeps the flag off for determinism.
  • Diff coverage ≥ 80% — the only executable changed line is the module-level flag assignment; .env.example and comment lines are non-executable. Ran focused tests + typecheck locally, not the full test:coverage merge.
  • N/A — no feature row added/removed/renamed in the coverage matrix (behaviour-only change).
  • All affected feature IDs listed under ## Related.
  • No new external network dependencies introduced.
  • N/A — does not change a release-cut smoke surface beyond exposing an already-documented-dark toggle.
  • N/A — no tracking issue; follow-up to Replace current voice chat with ElevenLabs Voice Agents #5399.

Impact

  • Desktop (all OSes). Frontend-only; no Rust core, no migration.
  • Exposes an existing, backend-ready feature's Settings toggle. Off-by-persisted-state until opted in, so no runtime behaviour change unless the user enables realtime voice mode. Reversible per-build via VITE_VOICE_MODE=false.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: N/A
  • Commit SHA: N/A

Validation Run

  • N/A
  • N/A
  • N/A
  • N/A
  • N/A

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: N/A
  • User-visible effect: N/A

Parity Contract

  • Legacy behavior preserved: N/A
  • Guard/fallback/dispatch parity checks: N/A

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: N/A
  • Resolution (closed/superseded/updated): N/A

VOICE_MODE_FLAG_ENABLED gated the Settings voice-mode toggle on a
build-time VITE_VOICE_MODE env var that was never wired into the desktop
build (build-desktop.yml). As a result the realtime voice mode section
never rendered in local, staging, or production builds — it only showed
in unit tests that mock the flag on.

Flip the flag to default-on with a kill switch (set VITE_VOICE_MODE=false
to hide it), matching the existing CHAT_ATTACHMENTS_ENABLED /
DERIVED_TRANSCRIPT_ENABLED default-on idiom in the same file. Document the
switch in app/.env.example.

The realtime code paths still gate on the persisted mascot.voiceMode, so
the feature stays dark until the user opts in via the now-visible toggle.
@YellowSnnowmann
YellowSnnowmann requested a review from a team August 7, 2026 12:10

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3a7f14fc-04fd-4be5-8e88-7e5e7e86549e

📥 Commits

Reviewing files that changed from the base of the PR and between fd6e8c6 and 5c9cea1.

📒 Files selected for processing (2)
  • app/.env.example
  • app/src/utils/config.ts

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

@M3gA-Mind
M3gA-Mind merged commit 35d8924 into tinyhumansai:main Aug 7, 2026
21 of 36 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.

2 participants