fix: remove defaultBaseUrl fallback in TTS availability check#593
Open
tongshu2023 wants to merge 1 commit into
Open
fix: remove defaultBaseUrl fallback in TTS availability check#593tongshu2023 wants to merge 1 commit into
tongshu2023 wants to merge 1 commit into
Conversation
…IC#574) 原因:isKeylessLocalProvider 的条件中包含了 config.defaultBaseUrl, 导致 VoxCPM、Lemonade 等无 API Key 的本地 TTS 提供者在用户未实际 部署服务时仍被标记为可用,智能体分配到不可用的提供者后静默失败。 修复:移除 defaultBaseUrl 的兜底条件,仅当用户在设置中明确配置了 serverBaseUrl 或 baseUrl 时才将无 Key 本地提供者标记为可用。 影响:1 文件,最小改动。修复后本地 TTS 提供者仅在用户显式配置了 URL 后才会出现在可用语音列表中,避免因默认地址导致运行时连接失败。
Contributor
|
Hello @tongshu2023! The fix itself is clean👍, but Prettier is failing: Could you run |
wyuc
requested changes
May 26, 2026
Contributor
wyuc
left a comment
There was a problem hiding this comment.
Thanks @tongshu2023, fix matches the #574 proposal exactly. Before merge:
- CI red on prettier. Run
pnpm exec prettier --write lib/audio/voice-resolver.tsand re-push. - Add a vitest: keyless provider with only
defaultBaseUrl(no user-setserverBaseUrl/baseUrl) should NOT appear in the returned list. - Add
Related to #587in the description. Its logs showlemonade-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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #574 — TTS provider availability check produces false positives for local keyless providers.
Problem
The
isKeylessLocalProvidercondition inlib/audio/voice-resolver.tsincludedconfig.defaultBaseUrlas 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.tslines 133-139 — theisKeylessLocalProvidercheck unconditionally acceptedconfig.defaultBaseUrlas a valid URL, ignoring whether the user had actually deployed and configured the server.Changes
lib/audio/voice-resolver.tsconfig.defaultBaseUrlfrom theisKeylessLocalProvideravailability checkserverBaseUrlorbaseUrlin their configurationTest Plan