From b28f2bcf6c3e88fcd15c5ab8aaeb2411f2945c34 Mon Sep 17 00:00:00 2001
From: Peer Hogeterp <20603780+peerschuett@users.noreply.github.com>
Date: Thu, 10 Sep 2026 17:02:25 +0200
Subject: [PATCH] Fixing some things left over
---
app/MindWork AI Studio/Provider/Model.cs | 21 +++++++-
.../OpenAI/ResponsesToolCallingAdapter.cs | 35 +++++++++++-
.../Provider/OpenAI/ThinkingContent.cs | 4 +-
.../Provider/OpenRouter/OpenRouterModel.cs | 22 +++++++-
.../Provider/OpenRouter/ProviderOpenRouter.cs | 4 +-
.../Settings/ProviderExtensions.Gateway.cs | 26 ++++++++-
.../Settings/ProviderExtensions.Reasoning.cs | 53 +++++++++++++++----
7 files changed, 147 insertions(+), 18 deletions(-)
diff --git a/app/MindWork AI Studio/Provider/Model.cs b/app/MindWork AI Studio/Provider/Model.cs
index 97ca3bbf..5961a2a6 100644
--- a/app/MindWork AI Studio/Provider/Model.cs
+++ b/app/MindWork AI Studio/Provider/Model.cs
@@ -1,3 +1,5 @@
+using System.Text.Json.Serialization;
+
using AIStudio.Tools.PluginSystem;
namespace AIStudio.Provider;
@@ -20,6 +22,12 @@ public readonly record struct Model(string Id, string? DisplayName)
///
public static readonly Model SYSTEM_MODEL = new(SYSTEM_MODEL_ID, null);
+ ///
+ /// The provider-reported default reasoning behavior, when the model catalog supplies it.
+ ///
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
+ public ModelReasoningBehavior ReasoningBehavior { get; init; }
+
///
/// Checks if this model is the system-configured placeholder.
///
@@ -71,4 +79,15 @@ public readonly record struct Model(string Id, string? DisplayName)
public override int GetHashCode() => this.Id?.GetHashCode(StringComparison.Ordinal) ?? 0;
#endregion
-}
\ No newline at end of file
+}
+
+///
+/// Describes the default reasoning behavior reported by a provider's model catalog.
+///
+public enum ModelReasoningBehavior
+{
+ UNKNOWN,
+ OPTIONAL,
+ DEFAULT_ON,
+ ALWAYS_ON,
+}
diff --git a/app/MindWork AI Studio/Provider/OpenAI/ResponsesToolCallingAdapter.cs b/app/MindWork AI Studio/Provider/OpenAI/ResponsesToolCallingAdapter.cs
index 5d30a623..f039a14b 100644
--- a/app/MindWork AI Studio/Provider/OpenAI/ResponsesToolCallingAdapter.cs
+++ b/app/MindWork AI Studio/Provider/OpenAI/ResponsesToolCallingAdapter.cs
@@ -15,6 +15,8 @@ public sealed class ResponsesToolCallingAdapter(Model chatModel, IList