From abc9cfdcc1c73c316f0b7fb467bffbd5717071f1 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Wed, 10 Jun 2026 16:33:29 -0700 Subject: [PATCH] fix(reasoning): wire reasoning-effort for Atlascloud, Moonshot, Ollama (#3024) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three providers previously had silent no-ops for all reasoning-effort tiers — the user toggled thinking on/off and nothing changed on the wire. This commit wires them: - Atlascloud: now speaks the DeepSeek dialect (thinking + reasoning_effort fields) since it serves DeepSeek models. All three arms (off, low–high, xhigh/max) updated. - Moonshot/Kimi: emits thinking: {type: disabled/enabled} for off/on. Kimi-k2.6 natively supports this field. - Ollama: emits think: false/true for off/on. Sent through the OpenAI-compatible /v1/chat/completions endpoint. Providers that remain unchanged: Openai, WanjieArk, OpenaiCodex (chat path), Arcee, Huggingface. --- crates/tui/src/client.rs | 50 ++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/crates/tui/src/client.rs b/crates/tui/src/client.rs index f7eb50b8..9d84b173 100644 --- a/crates/tui/src/client.rs +++ b/crates/tui/src/client.rs @@ -1248,12 +1248,22 @@ pub(super) fn apply_reasoning_effort( }); } ApiProvider::Openai - | ApiProvider::Atlascloud | ApiProvider::WanjieArk | ApiProvider::Arcee - | ApiProvider::Huggingface - | ApiProvider::Moonshot - | ApiProvider::Ollama => {} + | ApiProvider::Huggingface => {} + ApiProvider::Atlascloud => { + // #3024: Atlascloud serves DeepSeek models — speak the + // DeepSeek dialect instead of silently dropping the effort. + body["thinking"] = json!({ "type": "disabled" }); + } + ApiProvider::Moonshot => { + // #3024: Kimi models accept thinking enable/disable. + body["thinking"] = json!({ "type": "disabled" }); + } + ApiProvider::Ollama => { + // #3024: Ollama OpenAI-compat endpoint accepts think param. + body["think"] = json!(false); + } ApiProvider::NvidiaNim => { body["chat_template_kwargs"] = json!({ "thinking": false, @@ -1312,11 +1322,21 @@ pub(super) fn apply_reasoning_effort( body["reasoning_effort"] = json!(value); } ApiProvider::Openai - | ApiProvider::Atlascloud | ApiProvider::WanjieArk - | ApiProvider::Moonshot - | ApiProvider::Ollama | ApiProvider::OpenaiCodex => {} + ApiProvider::Atlascloud => { + // #3024: Atlascloud serves DeepSeek models. + body["reasoning_effort"] = json!("high"); + body["thinking"] = json!({ "type": "enabled" }); + } + ApiProvider::Moonshot => { + // #3024: Kimi models accept thinking enable. + body["thinking"] = json!({ "type": "enabled" }); + } + ApiProvider::Ollama => { + // #3024: Ollama think param. + body["think"] = json!(true); + } ApiProvider::NvidiaNim => { body["chat_template_kwargs"] = json!({ "thinking": true, @@ -1356,11 +1376,21 @@ pub(super) fn apply_reasoning_effort( body["reasoning_effort"] = json!("high"); } ApiProvider::Openai - | ApiProvider::Atlascloud | ApiProvider::WanjieArk - | ApiProvider::Moonshot - | ApiProvider::Ollama | ApiProvider::OpenaiCodex => {} + ApiProvider::Atlascloud => { + // #3024: Atlascloud serves DeepSeek models. + body["reasoning_effort"] = json!("high"); + body["thinking"] = json!({ "type": "enabled" }); + } + ApiProvider::Moonshot => { + // #3024: Kimi models accept thinking enable. + body["thinking"] = json!({ "type": "enabled" }); + } + ApiProvider::Ollama => { + // #3024: Ollama think param. + body["think"] = json!(true); + } ApiProvider::NvidiaNim => { body["chat_template_kwargs"] = json!({ "thinking": true,