Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

fix: address Codex P1/P2 — provider check and prompt override mode leak

Bezhan9b3f2bd99d34
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index e5223a71..9da41938 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -1749,7 +1749,8 @@ struct ContentView: View {
var finalText: String
// Check if we should use AI processing
- let shouldUseAI = DictationAIPostProcessingGate.isConfigured() || promptOverride != nil
+ let shouldUseAI = DictationAIPostProcessingGate.isConfigured() ||
+ (promptOverride != nil && DictationAIPostProcessingGate.isProviderConfigured())
if shouldUseAI {
DebugLogger.shared.debug("Routing transcription through AI post-processing", source: "ContentView")
@@ -2138,6 +2139,10 @@ struct ContentView: View {
}
private func setActiveRecordingMode(_ mode: ActiveRecordingMode) {
+ if mode != .promptMode {
+ self.promptModeOverrideText = nil
+ NotchContentState.shared.promptModeOverrideProfileName = nil
+ }
self.activeRecordingMode = mode
switch mode {
case .none, .dictate, .promptMode:
@@ -2153,8 +2158,6 @@ struct ContentView: View {
}
private func clearActiveRecordingMode() {
- self.promptModeOverrideText = nil
- NotchContentState.shared.promptModeOverrideProfileName = nil
self.setActiveRecordingMode(.none)
}
diff --git a/Sources/Fluid/Services/DictationAIPostProcessingGate.swift b/Sources/Fluid/Services/DictationAIPostProcessingGate.swift
index cee232de..15b30e30 100644
--- a/Sources/Fluid/Services/DictationAIPostProcessingGate.swift
+++ b/Sources/Fluid/Services/DictationAIPostProcessingGate.swift
@@ -25,6 +25,20 @@ enum DictationAIPostProcessingGate {
return !apiKey.isEmpty
}
+ /// Returns true if the selected AI provider is reachable/configured (API key or local endpoint),
+ /// regardless of the AI toggle or prompt selection. Used to gate prompt-mode hotkey AI processing.
+ static func isProviderConfigured() -> Bool {
+ let settings = SettingsStore.shared
+ let providerID = settings.selectedProviderID
+ if providerID == "apple-intelligence" {
+ return AppleIntelligenceService.isAvailable
+ }
+ let baseURL = self.baseURL(for: providerID, settings: settings)
+ if self.isLocalEndpoint(baseURL) { return true }
+ let apiKey = (settings.getAPIKey(for: providerID) ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
+ return !apiKey.isEmpty
+ }
+
static func baseURL(for providerID: String, settings: SettingsStore) -> String {
if let saved = settings.savedProviders.first(where: { $0.id == providerID }) {
return saved.baseURL.trimmingCharacters(in: .whitespacesAndNewlines)