Venice's API doesn't support certain OpenAI-compatible parameters that Clawdbot sends by default: - `store`: Venice returns HTTP 400 with no body when this is present - `developer` role: Not supported by Venice's API This adds VENICE_COMPAT settings (supportsStore: false, supportsDeveloperRole: false) to all Venice model definitions, both from the static catalog and dynamically discovered models. Fixes issues reported in PR #1666 where users experienced silent failures (HTTP 400, no body) when using Venice models. Co-authored-by: jonisjongithub <jonisjongithub@users.noreply.github.com> Co-authored-by: Clawdbot <bot@clawd.bot>
39 lines
1.6 KiB
Swift
39 lines
1.6 KiB
Swift
import Foundation
|
|
import Testing
|
|
@testable import Clawdbot
|
|
|
|
@Suite struct VoiceWakePreferencesTests {
|
|
@Test func sanitizeTriggerWordsTrimsAndDropsEmpty() {
|
|
#expect(VoiceWakePreferences.sanitizeTriggerWords([" clawd ", "", " \nclaude\t"]) == ["clawd", "claude"])
|
|
}
|
|
|
|
@Test func sanitizeTriggerWordsFallsBackToDefaultsWhenEmpty() {
|
|
#expect(VoiceWakePreferences.sanitizeTriggerWords(["", " "]) == VoiceWakePreferences.defaultTriggerWords)
|
|
}
|
|
|
|
@Test func sanitizeTriggerWordsLimitsWordLength() {
|
|
let long = String(repeating: "x", count: VoiceWakePreferences.maxWordLength + 5)
|
|
let cleaned = VoiceWakePreferences.sanitizeTriggerWords(["ok", long])
|
|
#expect(cleaned[1].count == VoiceWakePreferences.maxWordLength)
|
|
}
|
|
|
|
@Test func sanitizeTriggerWordsLimitsWordCount() {
|
|
let words = (1...VoiceWakePreferences.maxWords + 3).map { "w\($0)" }
|
|
let cleaned = VoiceWakePreferences.sanitizeTriggerWords(words)
|
|
#expect(cleaned.count == VoiceWakePreferences.maxWords)
|
|
}
|
|
|
|
@Test func displayStringUsesSanitizedWords() {
|
|
#expect(VoiceWakePreferences.displayString(for: ["", " "]) == "clawd, claude")
|
|
}
|
|
|
|
@Test func loadAndSaveTriggerWordsRoundTrip() {
|
|
let suiteName = "VoiceWakePreferencesTests.\(UUID().uuidString)"
|
|
let defaults = UserDefaults(suiteName: suiteName)!
|
|
|
|
#expect(VoiceWakePreferences.loadTriggerWords(defaults: defaults) == VoiceWakePreferences.defaultTriggerWords)
|
|
VoiceWakePreferences.saveTriggerWords(["computer"], defaults: defaults)
|
|
#expect(VoiceWakePreferences.loadTriggerWords(defaults: defaults) == ["computer"])
|
|
}
|
|
}
|