Skip to content

fix: remove defaultBaseUrl fallback in TTS availability check#593

Open
tongshu2023 wants to merge 1 commit into
THU-MAIC:mainfrom
tongshu2023:fix/tts-false-positive-574
Open

fix: remove defaultBaseUrl fallback in TTS availability check#593
tongshu2023 wants to merge 1 commit into
THU-MAIC:mainfrom
tongshu2023:fix/tts-false-positive-574

Conversation

@tongshu2023
Copy link
Copy Markdown
Contributor

Summary

Fixes #574 — TTS provider availability check produces false positives for local keyless providers.

Problem

The isKeylessLocalProvider condition in lib/audio/voice-resolver.ts included config.defaultBaseUrl as a fallback. This caused local keyless TTS providers (VoxCPM, Lemonade) to be marked as "available" even when the user had not deployed the corresponding server. Agents were then assigned to unreachable providers, resulting in silent TTS failures (connection refused) for some agents while others worked fine.

Root Cause

lib/audio/voice-resolver.ts lines 133-139 — the isKeylessLocalProvider check unconditionally accepted config.defaultBaseUrl as a valid URL, ignoring whether the user had actually deployed and configured the server.

Changes

  • 1 file changed: lib/audio/voice-resolver.ts
  • Removed config.defaultBaseUrl from the isKeylessLocalProvider availability check
  • Local keyless providers are now only available when the user explicitly sets serverBaseUrl or baseUrl in their configuration

Test Plan

  1. Deploy only Lemonade TTS server (do not deploy VoxCPM)
  2. Do not configure VoxCPM base URL in settings
  3. Generate a classroom
  4. ✅ All agent voices should use providers with actual configured URLs (no VoxCPM)
  5. ✅ Previously broken agents should no longer be assigned to unreachable providers

…IC#574)

原因:isKeylessLocalProvider 的条件中包含了 config.defaultBaseUrl,
导致 VoxCPM、Lemonade 等无 API Key 的本地 TTS 提供者在用户未实际
部署服务时仍被标记为可用,智能体分配到不可用的提供者后静默失败。

修复:移除 defaultBaseUrl 的兜底条件,仅当用户在设置中明确配置了
serverBaseUrl 或 baseUrl 时才将无 Key 本地提供者标记为可用。

影响:1 文件,最小改动。修复后本地 TTS 提供者仅在用户显式配置了
URL 后才会出现在可用语音列表中,避免因默认地址导致运行时连接失败。
@YizukiAme
Copy link
Copy Markdown
Contributor

Hello @tongshu2023! The fix itself is clean👍, but Prettier is failing:

pnpm exec prettier --check lib/audio/voice-resolver.ts
# Code style issues found in the above file.

Could you run pnpm exec prettier --write lib/audio/voice-resolver.ts and push the formatting fix? Should be a one-liner change.

Copy link
Copy Markdown
Contributor

@wyuc wyuc left a comment

Choose a reason for hiding this comment

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

Thanks @tongshu2023, fix matches the #574 proposal exactly. Before merge:

  • CI red on prettier. Run pnpm exec prettier --write lib/audio/voice-resolver.ts and re-push.
  • Add a vitest: keyless provider with only defaultBaseUrl (no user-set serverBaseUrl/baseUrl) should NOT appear in the returned list.
  • Add Related to #587 in the description. Its logs show lemonade-tts: fetch failed, consistent with this fix's symptom, but we can't tell from the report whether the user configured Lemonade explicitly. Worth asking the reporter to verify after merge.

Non-blocking: isLocalVoxCPM (lines 140–142 / 151) becomes redundant after this fix. Happy to take it as follow-up.

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.

TTS provider availability check produces false positives, breaking multi-agent TTS when local servers aren't running

3 participants