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:
Alan Wizemann
2026-03-31 14:03:34 -04:00
parent d31bc63b6a
commit ab45f95790
3 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -13,6 +13,7 @@ struct HermesConfig: Sendable {
var streaming: Bool var streaming: Bool
var showReasoning: Bool var showReasoning: Bool
var verbose: Bool var verbose: Bool
var autoTTS: Bool
static let empty = HermesConfig( static let empty = HermesConfig(
model: "unknown", model: "unknown",
@@ -26,7 +27,8 @@ struct HermesConfig: Sendable {
nudgeInterval: 0, nudgeInterval: 0,
streaming: true, streaming: true,
showReasoning: false, showReasoning: false,
verbose: false verbose: false,
autoTTS: true
) )
} }
@@ -42,7 +42,8 @@ struct HermesFileService: Sendable {
nudgeInterval: Int(values["memory.nudge_interval"] ?? "") ?? 0, nudgeInterval: Int(values["memory.nudge_interval"] ?? "") ?? 0,
streaming: values["display.streaming"] != "false", streaming: values["display.streaming"] != "false",
showReasoning: values["display.show_reasoning"] == "true", 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 @Observable
final class ChatViewModel { final class ChatViewModel {
private let dataService = HermesDataService() private let dataService = HermesDataService()
private let fileService = HermesFileService()
var recentSessions: [HermesSession] = [] var recentSessions: [HermesSession] = []
var sessionPreviews: [String: String] = [:] var sessionPreviews: [String: String] = [:]
@@ -63,6 +64,7 @@ final class ChatViewModel {
} else { } else {
sendToTerminal(tv, text: "/voice on\r") sendToTerminal(tv, text: "/voice on\r")
voiceEnabled = true voiceEnabled = true
ttsEnabled = fileService.loadConfig().autoTTS
} }
} }