mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Merged 3580 upstream commits from openclaw/main through a bridge branch that applied the openclaw→hanzo-bot rebrand before merging. Key upstream additions: - Android device diagnostics and notification actions - Device-auth v2 migration improvements - Docker CLI packaging fixes - Ollama discovery log demotion - Channel health monitoring - Slack native streaming - Linq iMessage channel - Gemini OAuth and FTS improvements - Inbound sender metadata - Daemon PATH improvements - Canvas host and onboarding enhancements - Security hardening (session files, exec allowlist)
37 lines
1.3 KiB
Swift
37 lines
1.3 KiB
Swift
import BotProtocol
|
|
import Testing
|
|
|
|
@testable import Bot
|
|
|
|
@Suite struct TalkModeConfigParsingTests {
|
|
@Test func prefersNormalizedTalkProviderPayload() {
|
|
let talk: [String: AnyCodable] = [
|
|
"provider": AnyCodable("elevenlabs"),
|
|
"providers": AnyCodable([
|
|
"elevenlabs": [
|
|
"voiceId": "voice-normalized",
|
|
],
|
|
]),
|
|
"voiceId": AnyCodable("voice-legacy"),
|
|
]
|
|
|
|
let selection = TalkModeRuntime.selectTalkProviderConfig(talk)
|
|
#expect(selection?.provider == "elevenlabs")
|
|
#expect(selection?.normalizedPayload == true)
|
|
#expect(selection?.config["voiceId"]?.stringValue == "voice-normalized")
|
|
}
|
|
|
|
@Test func fallsBackToLegacyTalkFieldsWhenNormalizedPayloadMissing() {
|
|
let talk: [String: AnyCodable] = [
|
|
"voiceId": AnyCodable("voice-legacy"),
|
|
"apiKey": AnyCodable("legacy-key"),
|
|
]
|
|
|
|
let selection = TalkModeRuntime.selectTalkProviderConfig(talk)
|
|
#expect(selection?.provider == "elevenlabs")
|
|
#expect(selection?.normalizedPayload == false)
|
|
#expect(selection?.config["voiceId"]?.stringValue == "voice-legacy")
|
|
#expect(selection?.config["apiKey"]?.stringValue == "legacy-key")
|
|
}
|
|
}
|