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

Narrow isReasoningModel to actual reasoning models

Yurii Chukhlibd512b9b49366
diff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swift
index d4b6e60b..cdc8bd39 100644
--- a/Sources/Fluid/Persistence/SettingsStore.swift
+++ b/Sources/Fluid/Persistence/SettingsStore.swift
@@ -2822,14 +2822,20 @@ final class SettingsStore: ObservableObject {
/// Global check if a model is a reasoning model (requires special params/max_completion_tokens)
func isReasoningModel(_ model: String) -> Bool {
- let modelLower = model.lowercased()
+ // Drop a provider/namespace prefix (e.g. OpenRouter's "openai/") so the
+ // family checks below match prefixed reasoning IDs like "openai/o3"
+ // without also matching every non-reasoning "openai/*" model (e.g.
+ // "openai/gpt-4o"), which would strip its temperature control.
+ var modelLower = model.lowercased()
+ if let slash = modelLower.firstIndex(of: "/") {
+ modelLower = String(modelLower[modelLower.index(after: slash)...])
+ }
return modelLower.hasPrefix("gpt-5") ||
modelLower.contains("gpt-5.") ||
modelLower.hasPrefix("o1") ||
modelLower.hasPrefix("o3") ||
modelLower.hasPrefix("o4") ||
modelLower.contains("gpt-oss") ||
- modelLower.hasPrefix("openai/") ||
(modelLower.contains("deepseek") && modelLower.contains("reasoner"))
}
diff --git a/Tests/FluidDictationIntegrationTests/TemperatureSupportTests.swift b/Tests/FluidDictationIntegrationTests/TemperatureSupportTests.swift
index 7e95801c..75a91cc8 100644
--- a/Tests/FluidDictationIntegrationTests/TemperatureSupportTests.swift
+++ b/Tests/FluidDictationIntegrationTests/TemperatureSupportTests.swift
@@ -41,6 +41,44 @@ final class TemperatureSupportTests: XCTestCase {
}
}
+ func testIsReasoningModel_doesNotMatchEveryOpenAIModel() {
+ // Regression: isReasoningModel matched the whole "openai/" prefix, so
+ // every OpenAI model on a provider like OpenRouter was mis-classified
+ // as a reasoning model and lost temperature control. Only actual
+ // reasoning model families should match.
+ let nonReasoning = [
+ "gpt-4o",
+ "gpt-4o-mini",
+ "gpt-4.1",
+ "chatgpt-4o-latest",
+ // Provider-prefixed (e.g. OpenRouter) non-reasoning IDs — the bug case
+ "openai/gpt-4o",
+ "openai/gpt-4.1",
+ "openai/gpt-4o-mini",
+ "openai/chatgpt-4o-latest",
+ ]
+ for model in nonReasoning {
+ XCTAssertFalse(
+ SettingsStore.shared.isReasoningModel(model),
+ "\(model) is not a reasoning model and must keep temperature control"
+ )
+ }
+
+ // Control: known reasoning models still classify as reasoning, both
+ // bare and provider-prefixed.
+ let reasoning = [
+ "o1", "o3-mini", "o4-mini", "gpt-5", "gpt-5-mini",
+ "openai/o3", "openai/o3-mini", "openai/gpt-5", "openai/gpt-oss-120b",
+ "deepseek/deepseek-reasoner",
+ ]
+ for model in reasoning {
+ XCTAssertTrue(
+ SettingsStore.shared.isReasoningModel(model),
+ "\(model) is a reasoning model"
+ )
+ }
+ }
+
func testTemperatureSupported_olderAndNonAnthropicModels() {
let supported = [
"gpt-4.1",
@@ -48,6 +86,9 @@ final class TemperatureSupportTests: XCTestCase {
"claude-sonnet-4-20250514",
"gemini-2.5-flash",
"llama3",
+ // OpenRouter-prefixed non-reasoning OpenAI models keep temperature
+ "openai/gpt-4o",
+ "openai/gpt-4.1",
// Dotted OpenRouter IDs for models that still accept temperature
"anthropic/claude-sonnet-4.6",
"anthropic/claude-sonnet-4.5",