Skip to content

fix(room-setup): name voice services still to set up in the AI voice warning - #1447

Open
KushalMohith18 wants to merge 2 commits into
fossasia:devfrom
KushalMohith18:fix/ai-voice-warning-providers
Open

KushalMohith18 wants to merge 2 commits into
fossasia:devfrom
KushalMohith18:fix/ai-voice-warning-providers

Conversation

@KushalMohith18

@KushalMohith18 KushalMohith18 commented Dec 1, 2026 •

Copy link
Copy Markdown

Description

The AI voice warning for a language that none of the event's configured voice services can speak said "None of this event's voice services can speak it". That hides the fact that a service the event has no key for yet (for example ElevenLabs for Thai) can speak it. The room setup now knows which voice services still need a key and which languages each speaks, and names them in the warning with a pointer to the API keys page. A language that no known service speaks keeps a plain message.

Related Issue

Closes #1443

Changes Made

  • EngineCatalog records the voice services the event has no key for (locked_voice) and exposes locked_voice_support (languages per service, by brand name).
  • room_setup.html passes it to the page as data-locked-voice-support.
  • room-setup.js uses it to name the services that can speak the language, e.g. "ElevenLabs can speak Thai: add its key on the event's API keys page".
  • Added a test for locked_voice_support.

Testing

Reproduced on dev in a local run: with a Deepgram key set, choosing Thai + AI voice showed "None of this event's voice services can speak it". On this branch, Thai and Hindi now say that ElevenLabs can speak them and how to add it.

  • Tested locally
  • Existing tests pass (uv run pytest tests/: 3797 passed, 18 skipped; ruff check clean)
  • Added/updated tests (if applicable)

Before (dev): on a test event with one voice service set up, choosing Thai with AI voice says "None of this event's voice services can speak it". That hides that ElevenLabs can speak Thai once its key is added.

1443-before.mp4

After: same steps, the warning says ElevenLabs can speak Thai and points to the API keys page.

1443-after.mp4

Checklist

  • My code follows the project's coding standards
  • I have tested my changes
  • I have updated documentation where necessary
  • My changes do not introduce new warnings or errors

Additional Notes

The case where no known service speaks a language is not reachable from the current language list, so it is covered by code only.

Created with Claude Sonnet 5.5 in Claude Code.

Summary by Sourcery

Tell room setup users which unconfigured voice services can support their selected language and how to enable them.

New Features:

  • Name voice services that can speak a language but are not yet configured with an event key, and direct users to the API keys page.

Bug Fixes:

  • Replace misleading AI voice warnings that imply no service can speak a language when a not-yet-configured service supports it.

Enhancements:

  • Keep the general warning when no available or addable voice service supports the selected language.

CI:

  • Run syntax validation and unit tests for the new voice-warning logic in CI.

Tests:

  • Add coverage for reporting locked voice-service language support and for the voice-warning cases.

Summary by CodeRabbit

  • Bug Fixes
    • Room setup now distinguishes languages unsupported by configured voice services from languages that could be supported by services requiring an event API key. Warnings identify relevant services and suggest available next steps, such as adding a key, switching to a configured service that supports the language, or using captions or Interpreter.

…warning

The warning for a language no configured voice service can speak said that
none of the event's voice services can speak it, which hides that a service
without a key yet (for example ElevenLabs for Thai) can. The setup now knows
which locked voice services speak each language and names them, with a pointer
to add the key. Languages no known service speaks keep a plain message.

Closes fossasia#1443
Copilot AI balanced review requested due to automatic review settings December 1, 2026 08:41
@sourcery-ai

sourcery-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Data structures

Extend the engine catalog with the missing-key voice providers and their language support so setup can identify which service could enable a language.

  • portal/room_setup.py L135-141 (+4 small edits)

Uses of the API

Pass the locked-provider support data into the warning helper and use its result in room setup.

  • portal/static/js/room-setup.js L89-96 (+3 small edits)

UI

Expose the locked voice-provider support catalog to the room setup page as a data attribute.

  • portal/templates/admin/room_setup.html L34

Configuration

Add the new voice-fit module syntax check and test to the CI workflow.

  • .github/workflows/tests.yml L300, L327

Tests

Verify that the catalog reports language support for locked voice providers and clears it when all relevant keys are configured.

  • tests/test_room_setup.py L1284-1295

Cover voice-warning behavior for configured, missing-key, and unsupported providers, including the no-service case.

  • tests/test_voice_fit.mjs L1-70

Other changes

Files not grouped.

  • portal/static/js/voice-fit.js L1-38

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Hi @KushalMohith18, thanks for your contribution!

Before we can review this PR, please add a short screencast video showing the change working (before/after where relevant).

If no video is added within 72 hours, this PR will be closed automatically. You are welcome to reopen it or submit a new PR once you have the screencast.

@github-actions github-actions Bot added ai-assisted PR created or assisted with an AI coding agent needs-screencast new-contributor labels Dec 1, 2026
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The room setup now exposes supported languages for voice providers that lack event API keys. Browser code uses this data to distinguish an unconfigured provider that supports a language from services that do not support it.

Changes: Voice availability

Layer / File(s) Summary
Build and expose locked voice-provider support
portal/room_setup.py, portal/templates/admin/room_setup.html, tests/test_room_setup.py
EngineCatalog maps locked voice providers to their supported languages. The template exposes this mapping, and a test checks the mapping for Deepgram and ElevenLabs.
Generate voice availability warnings
portal/static/js/voice-fit.js, portal/static/js/room-setup.js, tests/test_voice_fit.mjs, .github/workflows/tests.yml
voice-fit.js formats provider names and generates warnings using configured and locked provider support. The room setup passes it the selected voice and language data. Node tests cover warning cases, and the workflow checks the module and runs the tests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant EngineCatalog
  participant RoomSetupTemplate
  participant RoomSetupJS
  participant VoiceFit
  EngineCatalog->>RoomSetupTemplate: locked_voice_support
  RoomSetupTemplate->>RoomSetupJS: data-locked-voice-support
  RoomSetupJS->>VoiceFit: selected voice and language support
  VoiceFit->>RoomSetupJS: availability warning
Loading

Possibly related PRs

  • fossasia/voxbento#1277: Adds ElevenLabs as a voice provider and establishes catalog support used to identify locked providers.

Suggested reviewers: arnavballincode

Merge Risk: Minimal · up to 5a682

This change improves the room-setup voice warning so it names services that support the chosen language but still need an API key. The impact is limited to warning text, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main behavior change: the AI voice warning in room setup now names voice services that still need setup. The changeset adds locked voice-support data, passes it to the page, and up…
Linked Issues check Passed [#1443] The issue asks for four things: (1) a warning that separates languages the default voice services cannot speak from languages no available service can speak; (2) naming of alternative services…
Out of Scope Changes check Passed All changed areas support the #1443 warning behavior:
- portal/room_setup.py: adds locked_voice and locked_voice_support for the warning data.
- portal/templates/admin/room_setup.html: passes …
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main behavior change: the AI voice warning in room setup now names voice services that still need setup. The changeset adds locked voice-support data, passes it to the page, and updates the warning in voice-fit.js and room-setup.js to name those services. The title does not mention the API keys link or the no-service case, but it is specific and matches the primary change.

Full details: Linked Issues check

Explanation

[#1443] The issue asks for four things: (1) a warning that separates languages the default voice services cannot speak from languages no available service can speak; (2) naming of alternative services such as ElevenLabs; (3) availability based on configured providers, not a hardcoded language list; (4) interim options (AI captions or Interpreter).

At the reviewed head:

  • portal/room_setup.py: EngineCatalog.locked_voice lists voice services with no event key. locked_voice_support maps each such service's name to its supported languages. Availability comes from the event's keys and the service language data.
  • portal/templates/admin/room_setup.html: exposes the mapping as data-locked-voice-support.
  • portal/static/js/voice-fit.js: voiceProblem returns a warning for a language. If a locked service speaks the language, the text names it, e.g. "ElevenLabs can speak Thai: add its key on the event's API keys page", and offers AI captions or Interpreter. If a configured service speaks the language, the warning names it as a switch option. If no known service speaks the language, the text is a plain message.
  • portal/static/js/room-setup.js: calls voiceProblem with the configured engines, the selected provider, and the locked mapping.

The interim options named in the issue's suggested copy now appear in the warning. The wording differs from the issue text, which is a suggestion. The behavior the issue requests is present.

Limits: I read voice-fit.js and the start of room-setup.js at head. I did not read tests/test_voice_fit.mjs or the Python test body in this pass. The test claims rely on the change summary. The no-known-service branch is not reachable from the current language list, so it has no browser test. The issue does not require one.

Full details: Out of Scope Changes check

Explanation

All changed areas support the #1443 warning behavior:

  • portal/room_setup.py: adds locked_voice and locked_voice_support for the warning data.
  • portal/templates/admin/room_setup.html: passes that data to the page.
  • portal/static/js/voice-fit.js: new pure functions listNames and voiceProblem. They hold the warning logic so it can be tested without a DOM.
  • portal/static/js/room-setup.js: removes the local listNames and voiceProblem and imports them from voice-fit.js. This is a direct consequence of the extraction.
  • tests/test_voice_fit.mjs and tests/test_room_setup.py: tests for the warning and the locked mapping.
  • .github/workflows/tests.yml: runs node --check and the new Node test. This supports the new JavaScript file.

I found no unrelated feature, refactor, or documentation change in the summaries. The verdict uses the whole-PR summary and the inspected voice-fit.js and room-setup.js code.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07136c6c-9391-486e-93e5-fc35d232d1b0
Commits

Reviewing files that changed from the base of the PR and between 008abb8 and 5a682db.

Files selected for processing: 4

  • .github/workflows/tests.yml
  • portal/static/js/room-setup.js
  • portal/static/js/voice-fit.js
  • tests/test_voice_fit.mjs

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

@sourcery-ai

sourcery-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Linked issues

Checked at commit 5a682db

#1443 Incorrect AI Voice Availability Warning for Languages Supported by External Providers · 3 of 3 met

# Requirement Status Notes
1 Explain that the language is unsupported by the voice services currently set up for the event, not unavailable altogether. ✅ Met The warning distinguishes the event's set-up services from services that could be added.
2 Name other providers that support the language and explain how they can be configured later. ✅ Met The warning names matching locked providers and directs the organizer to add their key on the event's API keys page.
3 Base availability on the voice providers and language support rather than a hardcoded language restriction. ✅ Met Provider language support is supplied from the catalog and checked against both available and locked services.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="portal/static/js/room-setup.js" line_range="105" />
<code_context>
       return `${chosen.label} can't speak ${name}. Choose AI captions, or switch the voice to ${others[0].label} under AI services in the review step.`;
     }
-    return `AI voice isn't supported for ${name} yet. None of this event's voice services can speak it. Choose AI captions so listeners can read ${name}, or Interpreter.`;
+    const addable = Object.keys(lockedVoiceSupport).filter((brand) => lockedVoiceSupport[brand].includes(code));
+    if (addable.length) {
+      return `AI voice for ${name} isn't supported by the voice services set up for this event. ${listNames(addable)} can speak ${name}: add ${addable.length > 1 ? 'a key' : 'its key'} on the event's API keys page. Until then, choose AI captions so listeners can read ${name}, or Interpreter.`;
</code_context>
<issue_to_address>
**Users get the wrong voice setup advice**

When no voice engines are available and the selected language is supported by a locked provider, `voiceProblem` returns from its no-engines branch before checking `lockedVoiceSupport`, so users are told to add a Deepgram key even when Deepgram cannot speak the selected language and another locked provider can. Users receive misleading setup instructions.

Check `lockedVoiceSupport` before returning from the no-engines branch and give the matching provider and API-key guidance.
</issue_to_address>

### Comment 2
<location path="portal/static/js/room-setup.js" line_range="107" />
<code_context>
-    return `AI voice isn't supported for ${name} yet. None of this event's voice services can speak it. Choose AI captions so listeners can read ${name}, or Interpreter.`;
+    const addable = Object.keys(lockedVoiceSupport).filter((brand) => lockedVoiceSupport[brand].includes(code));
+    if (addable.length) {
+      return `AI voice for ${name} isn't supported by the voice services set up for this event. ${listNames(addable)} can speak ${name}: add ${addable.length > 1 ? 'a key' : 'its key'} on the event's API keys page. Until then, choose AI captions so listeners can read ${name}, or Interpreter.`;
+    }
+    return `AI voice isn't supported for ${name} yet. None of the voice services this server offers can speak it. Choose AI captions so listeners can read ${name}, or Interpreter.`;
</code_context>
<issue_to_address>
**New warning behavior goes untested**

When the warning's provider selection or message regresses, the new warning branch has no test exercising its provider selection or user-facing message, so a regression that omits the missing service or API-key guidance leaves the suite green and the feature broken.

Add a test that exercises the new warning behavior, including the missing-service name and API-key guidance.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: portal/static/js/room-setup.js:105, portal/static/js/room-setup.js:107


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread portal/static/js/room-setup.js Resolved
Comment thread portal/static/js/room-setup.js Resolved
… test the warning

With no voice service set up, the warning always told the owner to add a Deepgram key, even when only another service (for example ElevenLabs for Thai) speaks the language. The warning logic moves to voice-fit.js, which now names the services that speak the language in that case too, and tests/test_voice_fit.mjs covers each branch. CI runs the new test and a syntax check.
Copilot AI balanced review requested due to automatic review settings December 1, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Thank you @KushalMohith18 for adding a screencast! The needs-screencast label has been removed and this PR is ready for maintainer review.

@KushalMohith18

Copy link
Copy Markdown
Author

CI note: docker-smoke and floor-bot-smoke failed on this PR.

The failure is in the floor-bot image build: apt-get update could not reach security.ubuntu.com (Could not wait for server fd). The jobs ran at about 14:35 to 14:45 UTC, right after the workflows were approved. This PR does not touch the Dockerfiles or floor-bot/. I could not find a cause in this change: I reproduced the same stall on unmodified dev locally, and on a retry the floor-bot image built fine. docker compose build (all images) and the portal image, started and checked, also pass locally on this branch with CI's environment. Every other check passes (all pytest shards, unit tests, Bandit, Semgrep, CodeQL).

I do not have permission to re-run workflows. Could a maintainer re-run the failed jobs?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted PR created or assisted with an AI coding agent new-contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect AI Voice Availability Warning for Languages Supported by External Providers

2 participants