mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-08 02:14:37 +00:00
Fix TTS toggle state reversed on voice enable
Hermes auto-enables TTS when voice mode turns on (auto_tts config). Our ttsEnabled started as false, so the UI showed off when TTS was actually on. Now reads auto_tts from config.yaml when voice enables and sets the initial state to match. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ struct HermesConfig: Sendable {
|
||||
var streaming: Bool
|
||||
var showReasoning: Bool
|
||||
var verbose: Bool
|
||||
var autoTTS: Bool
|
||||
|
||||
static let empty = HermesConfig(
|
||||
model: "unknown",
|
||||
@@ -26,7 +27,8 @@ struct HermesConfig: Sendable {
|
||||
nudgeInterval: 0,
|
||||
streaming: true,
|
||||
showReasoning: false,
|
||||
verbose: false
|
||||
verbose: false,
|
||||
autoTTS: true
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,8 @@ struct HermesFileService: Sendable {
|
||||
nudgeInterval: Int(values["memory.nudge_interval"] ?? "") ?? 0,
|
||||
streaming: values["display.streaming"] != "false",
|
||||
showReasoning: values["display.show_reasoning"] == "true",
|
||||
verbose: values["agent.verbose"] == "true"
|
||||
verbose: values["agent.verbose"] == "true",
|
||||
autoTTS: values["voice.auto_tts"] != "false"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import SwiftTerm
|
||||
@Observable
|
||||
final class ChatViewModel {
|
||||
private let dataService = HermesDataService()
|
||||
private let fileService = HermesFileService()
|
||||
|
||||
var recentSessions: [HermesSession] = []
|
||||
var sessionPreviews: [String: String] = [:]
|
||||
@@ -63,6 +64,7 @@ final class ChatViewModel {
|
||||
} else {
|
||||
sendToTerminal(tv, text: "/voice on\r")
|
||||
voiceEnabled = true
|
||||
ttsEnabled = fileService.loadConfig().autoTTS
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user